Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SvelteKit with web worker -> TypeError: Cannot read properties of undefined (reading 'file') #12745

Closed
7 tasks done
peterpeterparker opened this issue Apr 5, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@peterpeterparker
Copy link

peterpeterparker commented Apr 5, 2023

Describe the bug

Building a SvelteKit project (static adapter) that loads a web worker with last version of Vite which relies on Rollup v3.20.2 leads to following issue:

[vite-plugin-sveltekit-compile] Cannot read properties of undefined (reading 'file')
✓ built in 262ms
error during build:
TypeError: Cannot read properties of undefined (reading 'file')
at file:///Users/daviddalbusco/projects/lab/my-project-webworker/node_modules/@sveltejs/kit/src/exports/vite/build/build_server.js:74:83
at Array.forEach ()

Downgrading Rollup to v3.15.0 resolve the problem.

Note: it might no be a Vite issue but, Rollup. Not knowing where to report it, I thought about opening this issue first. If I should forward the question to Rollup, let me know.

Reproduction

https://github.com/peterpeterparker/my-project-webworker

Steps to reproduce

git clone https://github.com/peterpeterparker/my-project-webworker
cd my-project-webworker
npm ci
npm run build

note: the project also contains a branch build/ok-rollup-3.15.0 which displays that downgrading fixes the issue

System Info

❯ npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers

  System:
    OS: macOS 13.3
    CPU: (8) arm64 Apple M2
    Memory: 98.48 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - /usr/local/bin/node
    npm: 9.6.1 - /opt/homebrew/bin/npm
  Browsers:
    Brave Browser: 111.1.49.132
    Chrome: 111.0.5563.146
    Firefox: 111.0.1
    Safari: 16.4
  npmPackages:
    vite: ^4.2.0 => 4.2.1

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red
Copy link
Member

Updating Vite to 4.3.0-beta.2 worked. I think this is a duplicate of #10190.

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed pending triage labels Apr 5, 2023
@peterpeterparker
Copy link
Author

Agree @sapphi-red it looks like 4.3.0-beta.2 solves it. Thanks for the feedback!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants