Repository navigation
fix: keep nested worker assets live across tree-shaken main refs - #23899
Open
FelixFangX wants to merge 1 commit into
Open
FelixFangX wants to merge 1 commit into
FelixFangX wants to merge 1 commit into
Conversation
FelixFangX
force-pushed
the
fix/nested-worker-tree-shaken-emit
branch
2 times, most recently
from
October 27, 2026 08:09
18f1250 to
86f7a14
Compare
When a nested worker's starter module is tree-shaken from the client graph but still used by an outer worker, cleanup was deleting the helper asset. Preserve transitively live worker assets in both main and worker builds. Fixes vitejs#23894
FelixFangX
force-pushed
the
fix/nested-worker-tree-shaken-emit
branch
from
October 27, 2026 13:28
86f7a14 to
c611154
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Nested workers were dropped from
dist/when their starter module was also present in the client graph and got tree-shaken there, while an outer worker still needed them. Cleanup treated the nested worker as dead after the main-graph reference vanished, even though another live worker still referenced the helper asset.This keeps transitively live worker assets when filtering dead references in both main and worker builds, and adds a regression fixture matching the #23894 shape.
Fixes #23894
Additional context
Reproduced with the issue gist on Vite 8.3.5 (
helper-*.jsmissing). After this change, the same gist against a local build reportsOK: nested worker emitted. Related nearby work: #23848 / #23874 (nested worker caching).What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).