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

Building blocked if using Web Workers / Missing files in Vite manifest #9600

Closed
regnaio opened this issue Apr 5, 2023 · 2 comments
Closed

Comments

@regnaio
Copy link

regnaio commented Apr 5, 2023

Describe the bug

Initializing a Web Worker in a TypeScript file imported into a Svelte component as recommended by Vite:

new Worker(new URL('./core/worker', import.meta.url));

Building fails with the error: [vite-plugin-sveltekit-compile] Could not find file "node_modules/@sveltejs/kit/src/runtime/client/start.js" in Vite manifest

Is this related? fix: throw error when file can't be found in Vite manifest #9558

This used to build fine. Last @sveltejs/kit version I was on where this worked was 1.0.1

npm run build

...
✓ built in 19.21s
[vite-plugin-sveltekit-compile] Could not find file "node_modules/@sveltejs/kit/src/runtime/client/start.js" in Vite manifest
✓ built in 25.84s
error during build:
Error: Could not find file "node_modules/@sveltejs/kit/src/runtime/client/start.js" in Vite manifest
    at resolve_symlinks (file:///home/gbz/app/svelte/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js:76:28)
    at find_deps (file:///home/gbz/app/svelte/node_modules/@sveltejs/kit/src/exports/vite/build/utils.js:57:26)
    at Object.handler (file:///home/gbz/app/svelte/node_modules/@sveltejs/kit/src/exports/vite/index.js:724:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async PluginDriver.hookParallel (file:///home/gbz/app/svelte/node_modules/rollup/dist/es/shared/node-entry.js:24317:17)
    at async file:///home/gbz/app/svelte/node_modules/rollup/dist/es/shared/node-entry.js:25678:13
    at async catchUnfinishedHookActions (file:///home/gbz/app/svelte/node_modules/rollup/dist/es/shared/node-entry.js:24758:20)
    at async build (file:///home/gbz/app/svelte/node_modules/vite/dist/node/chunks/dep-79892de8.js:46246:22)
    at async CAC.<anonymous> (file:///home/gbz/app/svelte/node_modules/vite/dist/node/cli.js:813:9)

After the failed build, I looked in .svelte-kit/output/client/vite-manifest.json, which only has:

{
  "src/lib/ts/game/core/worker.ts": {
    "file": "_app/immutable/workers/worker-ed4c4268.js",
    "isEntry": true,
    "src": "src/lib/ts/game/core/worker.ts"
  }
}

Looks like node_modules/@sveltejs/kit/src/runtime/client/start.js is missing

Reproduction

Broken on Latest:
create-svelte@3.2.0
@sveltejs/kit@1.15.1

Used to work on:
@sveltejs/kit@1.0.1

Don't know exactly which version of @sveltejs/kit this broke

Logs

No response

System Info

npx envinfo --system --binaries --browsers --npmPackages "{svelte,@sveltejs/*,vite}"

  System:
    OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
    Memory: 8.23 GB / 15.54 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 18.12.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.2.0 - /usr/local/bin/npm
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.0.0
    @sveltejs/adapter-static: ^2.0.1 => 2.0.1
    @sveltejs/kit: ^1.5.0 => 1.15.1
    svelte: ^3.54.0 => 3.58.0
    vite: ^4.2.0 => 4.2.1

Severity

blocking an upgrade

Additional Information

No response

@regnaio regnaio changed the title [vite-plugin-sveltekit-compile] Could not find file "node_modules/@sveltejs/kit/src/runtime/client/start.js" in Vite manifest Blocked Build: [vite-plugin-sveltekit-compile] Could not find file "node_modules/@sveltejs/kit/src/runtime/client/start.js" in Vite manifest Apr 5, 2023
@regnaio regnaio changed the title Blocked Build: [vite-plugin-sveltekit-compile] Could not find file "node_modules/@sveltejs/kit/src/runtime/client/start.js" in Vite manifest Building blocked if using Web Workers Apr 5, 2023
@regnaio regnaio changed the title Building blocked if using Web Workers Building blocked if using Web Workers | Missing files in Vite manifest Apr 5, 2023
@regnaio regnaio changed the title Building blocked if using Web Workers | Missing files in Vite manifest Building blocked if using Web Workers / Missing files in Vite manifest Apr 5, 2023
@jsilveira
Copy link

I'm getting the same error when trying to build a project with @sveltejs/kit 1.5.0 that uses a Worker. I hadn't connected it with the Worker until I saw this issue. Any ideas on a workaround?

@dummdidumm
Copy link
Member

Closing as duplicate of #9528 which also contains a workaround until it's fixed in Vite.

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants