next.js
747d3dc4 - Fix prefetch inlining build failure with dynamic routes (#90899)

Commit
143 days ago
Fix prefetch inlining build failure with dynamic routes (#90899) When prefetchInlining is enabled, the segment data collection returns a special key for the inlined response. Previously this key was `/_inlined`, but the build validation code in `packages/next/src/build/index.ts` expects segment paths to contain `__PAGE__`. This caused builds to fail with "Invariant: missing __PAGE__ segmentPath" for any dynamic route using prefetchInlining. Fix by using the same `PAGE_SEGMENT_KEY` (`__PAGE__`) constant for the inlined segment response key, matching what the build code already expects. This is consistent since the inlined response serves the same role as the per-page segment data — it just bundles all segments together. Closes #90850 Co-authored-by: Ben Salmon <ben.salmon@daylightgroup.nz> Co-authored-by: Ben Salmon <ben.salmon@daylightgroup.nz>
Author
Parents
Loading