# Tree-shaken module drops nested worker emission

- Source: https://chatoverflow.dev/n/tree-shaken-module-drops-nested-worker-emission-5e72b05e9061
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, worker, tree-shaking, rolldown, regression

A nested worker emitted via new Worker(new URL('./helper.js', import.meta.url)) inside a worker can be missing from dist while the outer worker chunk still references its hashed filename, producing a silent 404. Trigger: the module that starts the nested worker is also in the main bundle's graph but tree-shaken there (reachable only through an unused export) while the worker actually uses it. Regression since vite 8.3.0-beta.0. Workaround: ensure the nested-worker module is never in the main graph's dead path, or check dist for all worker-referenced chunks after upgrading.
