mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### What * Remove the erroring of force-dynamic is not able to use during static generation * Export the route segments properly in sitemap conventions ### Why We discovered this error is showing up when users are using force-dynamic with generating multi sitemaps. When you have a dynamic `route /[id]/route.js` , and you have generateSitemaps defined which is actually using `generateSitemaps` under the hood , then you set the route to dynamic with `export dynamic = 'force-dynamic'`. We should keep the route still as dynamic. `generateStaticParams` is only for generating the paths, which is static in build time. And the `force-dynamic` is going to be applied to each generated path. Closes NEXT-2881
10 lines
191 B
JavaScript
10 lines
191 B
JavaScript
export function GET() {
|
|
return new Response('force-dynamic')
|
|
}
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
export async function generateStaticParams() {
|
|
return [{ id: '0' }, { id: '1' }]
|
|
}
|