next.js
1219f499 - Turbopack: fix empty tree-shake chunks desyncing part ids (#93424) (#95516)

Commit
31 days ago
Turbopack: fix empty tree-shake chunks desyncing part ids (#93424) (#95516) split_module skipped chunks whose body ended up empty, but the group index is used directly as a part id by outputs (Key::Export/Key::ModuleEvaluation), part_deps, and the PartId::Internal asserts embedded in the emitted chunk ASTs. Skipping shifted every later module's position and desynced those indices, causing out-of-bounds panics in split_module and wrong-fragment selection in part_of_module. Always push a module for every group; use a well-formed side-effect-free `export {}` placeholder when the body is empty. Update tree-shaker analyzer snapshots to include the placeholder parts.
Author
Parents
Loading