You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow dynamicParams on Pages, Layouts, and Route Handlers when Cache Components is enabled.
Preserve the incompatibility error for metadata convention files, whose loader intentionally filters this export.
Add end-to-end coverage for exact nested tuples, layout and page generators, Route Handlers, required and optional catch-alls, RSC requests, cold and warm 404s, and the prerender manifest.
Document the closed-route behavior and its deployment-time lifetime.
Why
Cache Components currently rejects dynamicParams = false, so generateStaticParams() can only seed prerendering. Unknown parameter tuples remain renderable on demand, which prevents applications from preserving the fallback: false contract and returning a hard 404 before a route renders or streams.
The existing static-path pipeline still supports this contract. It records generated concrete paths in prerenderManifest.routes, emits fallback: false for the dynamic pattern, and rejects an unknown pathname before selecting a fallback shell or invoking the Page component or GET handler. The compiler restriction is the missing link.
This draft restores the existing API rather than adding another allowlist format. It addresses #95107 and gives the open API discussion in #84991 a concrete implementation to evaluate.
How
The React Server Components validator now accepts dynamicParams for page, layout, and route entries under Cache Components. Metadata convention entries continue to error because their generated Route Handler does not re-export dynamicParams; accepting it there would silently ignore the setting.
No runtime or manifest schema changes are required. The restored behavior uses the existing complete leaf-route tuple semantics:
The merged parameter combinations produced by parent and child generateStaticParams() functions are the closed set for that deployment.
Unknown combinations return 404 before the Page component or GET handler runs and before a fallback shell is selected.
ISR can refresh a generated path, but it cannot add a new parameter combination. Publishing new paths requires a deployment.
Draft Mode continues to bypass the production fallback restriction.
Segment-granular prefix allowlists and mutable post-deployment membership remain separate design questions.
Verification
pnpm build-all
pnpm --filter=next types
cargo test -p next-custom-transforms --test errors react_server_components_errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
dynamicParamson Pages, Layouts, and Route Handlers when Cache Components is enabled.Why
Cache Components currently rejects
dynamicParams = false, sogenerateStaticParams()can only seed prerendering. Unknown parameter tuples remain renderable on demand, which prevents applications from preserving thefallback: falsecontract and returning a hard 404 before a route renders or streams.The existing static-path pipeline still supports this contract. It records generated concrete paths in
prerenderManifest.routes, emitsfallback: falsefor the dynamic pattern, and rejects an unknown pathname before selecting a fallback shell or invoking the Page component orGEThandler. The compiler restriction is the missing link.This draft restores the existing API rather than adding another allowlist format. It addresses #95107 and gives the open API discussion in #84991 a concrete implementation to evaluate.
How
The React Server Components validator now accepts
dynamicParamsforpage,layout, androuteentries under Cache Components. Metadata convention entries continue to error because their generated Route Handler does not re-exportdynamicParams; accepting it there would silently ignore the setting.No runtime or manifest schema changes are required. The restored behavior uses the existing complete leaf-route tuple semantics:
generateStaticParams()functions are the closed set for that deployment.GEThandler runs and before a fallback shell is selected.Segment-granular prefix allowlists and mutable post-deployment membership remain separate design questions.
Verification
pnpm build-allpnpm --filter=next typescargo test -p next-custom-transforms --test errors react_server_components_errorspnpm test-start-turbo test/e2e/app-dir/cache-components-dynamic-params-false/cache-components-dynamic-params-false.test.tspnpm test-start-webpack test/e2e/app-dir/cache-components-dynamic-params-false/cache-components-dynamic-params-false.test.tspnpm test-dev-turbo test/e2e/app-dir/cache-components-dynamic-params-false/cache-components-dynamic-params-false.test.tspnpm test-dev-webpack test/e2e/app-dir/cache-components-dynamic-params-false/cache-components-dynamic-params-false.test.tspnpm test-start-turbo test/e2e/app-dir/cache-components-segment-configs/cache-components-segment-configs.test.tspnpm test-start-webpack test/e2e/app-dir/cache-components-segment-configs/cache-components-segment-configs.test.ts