Files
Josh StoryandGitHub 6a39e9d223 [Cache Components] Exclude dynamic params from prerenders when no generateStaticParams values is provided (#95872)
Fixes an issue in self-hosted and Vercel Adapter that causes some routes
that prerender static pages to include more route params than expected
when running in Cache Components.

For all Next.js environments any route matching a root param not already
in the cache will result in a prerender that includes all params
regardless of whether they were omitted from generateStaticParams.

For Vercel Adapter environments any route without a fallback that has an
empty shell during the build will prerender misses with all params
regardless of whether they were omitted from generateStaticParams.

This change fixes both issues and introduces a comprehensive test matrix
to catch regressions in these kinds of prerender decisions in the future

closes NAR-882
2026-07-22 15:28:42 -07:00

17 lines
633 B
TypeScript

import { ReactNode } from 'react'
// Root layout for the dynamic-param/with-root-param TOMBSTONE. Note the
// placement: this root layout sits ABOVE the catch-all segment, so the
// segment params are NOT root params — which is exactly why this route can
// build while the combination it documents cannot: a real
// with-root-param branch would put the root layout inside [lang], and root
// params must be provided by generateStaticParams, which the dynamic-param
// matrix doesn't have.
export default function Root({ children }: { children: ReactNode }) {
return (
<html>
<body>{children}</body>
</html>
)
}