Skip to content

Imported worker missing from Vite build manifest #23377

Description

@teemingc

Describe the bug

Vite handles imported workers and these show up when building an app (as shown in the last line of the following logs):

vite v8.2.1 building client environment for production...
✓ 1502 modules transformed.
computing gzip size...
.svelte-kit/output/client/_app/immutable/assets/example.kaL65i_D.json        0.01 kB │ gzip:  0.03 kB
.svelte-kit/output/client/_app/version.json                                  0.02 kB │ gzip:  0.04 kB
.svelte-kit/output/client/_app/immutable/workers/worker-CligqNjd.js          0.11 kB

However, the worker isn't included in the Vite build manifest. SvelteKit uses the build manifest to collect assets which the app may want to cache as part of their service worker strategy (illustrated in the docs).

Reproduction

https://github.com/teemingc/vite-worker-manifest-repro

Steps to reproduce

Instructions are in the README.md of the reproduction

System Info

System:
    OS: macOS 27.0
    CPU: (8) arm64 Apple M1 Pro
    Memory: 917.61 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.18.0 - /Users/teeming/Library/pnpm/bin/node
    Yarn: 1.22.22 - /Users/teeming/Library/pnpm/bin/yarn
    npm: 11.18.0 - /Users/teeming/Library/pnpm/bin/npm
    pnpm: 11.22.0 - /Users/teeming/Library/pnpm/bin/pnpm
    bun: 1.4.0 - /opt/homebrew/bin/bun
    Deno: 2.8.2 - /Users/teeming/.deno/bin/deno
  npmPackages:
    vite: ^8.2.2 => 8.2.2

Used Package Manager

pnpm

Logs

❯ pnpm build
$ tsc && vite build
vite v8.2.2 building client environment for production...
✓ 5 modules transformed.
computing gzip size...
dist/assets/worker-CS9v0tXh.js 0.04 kB
dist/.vite/manifest.json 0.13 kB │ gzip: 0.11 kB
dist/index.html 0.38 kB │ gzip: 0.26 kB
dist/assets/index-xI8nRDUE.js 0.77 kB │ gzip: 0.45 kB

✓ built in 37ms

Validations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions