Back to all fixes
CuratedTypeScriptVite 8local

Rolldown merges separate entry points, executing an unrelated entry's side effects

Problem

With manual code splitting plus rolldown's `entriesAwareMergeThreshold` chunk optimization, two independent entry points that only share a small chunk can get merged so that loading entry `a` also runs entry `b`'s top-level side effects (e.g. two entries each mounting a different Vue/React app end up both mounting when only one was requested). It merges whole entries together, not just the small shared chunk.

Solution

typescript
Maintainer-confirmed workaround: set both `strictExecutionOrder: true` AND `chunkOptimization: false` in the rolldown build options. `strictExecutionOrder: true` alone is not sufficient because rolldown's `chunkOptimization` phase has its own separate tracked bug (issue #9463) that defeats it; disabling `chunkOptimization` entirely is required as the current stopgap. Per the maintainer, `strictExecutionOrder: true` is the intended long-term correct setting for guaranteeing execution order once #9463 is fixed — `entriesAwareMergeThreshold`/automatic code splitting does not guarantee execution-order correctness by design.