Skip to content

Commit 449fbc5

Browse files
brenelzclaude
andcommitted
fix: make lazy facade entry reclassification effective under rolldown-vite
normalizeEmittedLazyEntries used `delete entry.isEntry` to reclassify emitted lazy facade chunks as dynamic entries. Under rolldown-vite (Vite 8) the bundle passed to generateBundle materializes chunks as proxies over native data: property assignment is trapped and synced back to the native bundle after the hook, but a delete falls through to the throwaway JS target while the proxy's read cache keeps serving the previously read value. The reclassification therefore silently no-oped and downstream plugins still saw every facade chunk flagged isEntry, e.g. TanStack Start failing client builds with "multiple entries detected". Assign `isEntry = false` instead, which behaves identically on plain objects (Rollup bundles and the parsed Vite manifest.json). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 56217a3 commit 449fbc5

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'vite-plugin-solid': patch
3+
---
4+
5+
Reclassify emitted lazy facade chunks by assigning `isEntry = false` instead of deleting the property. Under rolldown-vite (Vite 8), bundle chunks in `generateBundle` are proxies whose set trap syncs assignments back to the native bundle, while a delete is swallowed by the proxy's read cache — so the reclassification silently no-oped and downstream plugins (e.g. TanStack Start's manifest plugin) still saw every lazy facade chunk as an application entry, failing builds with "multiple entries detected".

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ function normalizeEmittedLazyEntries(manifest: Record<string, any>) {
268268
for (const key of dynamicKeys) {
269269
const entry = manifest[key];
270270
if (entry && entry.isEntry) {
271-
delete entry.isEntry;
271+
// Assign rather than delete: rolldown-vite materializes bundle chunks
272+
// as proxies whose set trap syncs changes back to the native bundle,
273+
// while a delete is swallowed by the proxy's read cache and never
274+
// reaches it (or downstream plugins).
275+
entry.isEntry = false;
272276
entry.isDynamicEntry = true;
273277
}
274278
}

0 commit comments

Comments
 (0)