Skip to content

Fix manualChunks misclassifying CJS interop modules#158

Closed
puckey wants to merge 1 commit intomainfrom
fix/manual-chunks-cjs-interop
Closed

Fix manualChunks misclassifying CJS interop modules#158
puckey wants to merge 1 commit intomainfrom
fix/manual-chunks-cjs-interop

Conversation

@puckey
Copy link
Copy Markdown
Contributor

@puckey puckey commented Mar 19, 2026

  • Rollup prefixes virtual module IDs (e.g. CJS interop for ?commonjs-module) with \0, causing startsWith() checks in manualChunks to fail
  • This misrouted modules into wrong chunks, creating circular chunk dependencies and TDZ errors (e.g. @lk77/vue3-color CJS requiring vue)
  • Strip the \0 prefix before matching against local paths

Rollup prefixes virtual module IDs (e.g. CJS interop for ?commonjs-module)
with \0, causing startsWith() checks to fail. This misrouted modules into
wrong chunks, creating circular chunk dependencies and TDZ errors
(e.g. vue3-color CJS requiring vue). Strip the \0 prefix before matching.
@puckey
Copy link
Copy Markdown
Contributor Author

puckey commented Mar 19, 2026

looks like the vite 8 update made this unnecessary

@puckey puckey closed this Mar 19, 2026
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

Successfully merging this pull request may close these issues.

1 participant