mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Returning an empty array from `generateStaticParams` should still be deployed as an ISR route to support the `dynamicParams = true` case, where a route can be generated & cached on demand. At the moment the only way to achieve this behavior is with `export const dynamic = 'force-static'`. As a result, these routes are being treated as dynamic and never return a cached response. This PR resolves the bug by fixing several distinct things: - `prerenderedRoutes` does not need to be an array > 0 to mark a route as being a static path. This will ensure the build output shows the correct symbol and adds the path to the list of prerenders. - we initialize `prerenderedRoutes` to an empty array if we determine that the leaf-most segment (the thing rendering the current page) has a `generateStaticParams` function - the function responsible for collecting segments associated with a page only considered the `children` branch, but for something like a parallel/interception route, those segments would be inside of a different parallel route key - the regex for determining if a function was dynamic didn't consider that the dynamic route might also contain an interception marker (eg `(.)`) This appears to have regressed in #68125 Closes NEXT-3905 --------- Co-authored-by: Wyatt Johnson <[email protected]>
7 lines
96 B
JavaScript
7 lines
96 B
JavaScript
/**
|
|
* @type {import('next').NextConfig}
|
|
*/
|
|
const nextConfig = {}
|
|
|
|
module.exports = nextConfig
|