next.js
290ecac9 - fix(build): add sourcePage context for PPR dynamic route lambda creation (#81781)

Commit
160 days ago
fix(build): add sourcePage context for PPR dynamic route lambda creation (#81781) ### What? This PR adds a `sourcePage` property to dynamic routes in the routes manifest to provide the necessary context for lambda creation during the build process when PPR is enabled. ### Why? The build process was missing the required context to properly create lambdas for dynamic routes when PPR is enabled. Without the source page information, the build couldn't determine which page a dynamic route originated from, preventing correct lambda generation. ### How? - Added a new `DynamicManifestRoute` type that extends `ManifestRoute` with an optional `sourcePage` property - Updated the `pageToRoute` function with overloads to pass the source page context - Modified the routes manifest generation to include the source page when creating dynamic routes for PPR-enabled pages - The `sourcePage` property is only populated for app pages when PPR is enabled (remains `undefined` for regular dynamic routes) This ensures the build process has the necessary context to create the underlying lambdas correctly.
Author
Parents
Loading