mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Follow-up to #91189 which added support for accessing root params inside `generateStaticParams`. Previously, if a `generateStaticParams` function tried to read a root param that hasn't been defined yet — either because the current segment is supposed to define it, or because a child segment defines it — `getRootParam` would silently return `undefined`. This is especially problematic because #91019 will type root param getters as `Promise<string>` without `undefined`, making this a silent type safety violation. This change makes `getRootParam` throw an explicit error with the `generate-static-params` work unit store when the requested param is not present in `rootParams`.