-
Hello, Our website has been slow for months.
I did everything NextJS recommended to have SSG / ISR working correctly. One of them was: Error: Route /[locale]/file/things `dynamic = "error"` couldn't be rendered statically because it used `headers`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering
at requestLocale (src/i18n/request.ts:5:40)
at Module.generateMetadata (src/app/[locale]/file/things/page.tsx:40:34)
3 | import { hasLocale } from 'next-intl';
4 |
> 5 | export default getRequestConfig(async ({requestLocale}) => {
| ^
6 | // Validate that the incoming `locale` parameter is valid
7 | const requested = await requestLocale;
8 | let locale = hasLocale(routing.locales, requested) {
code: 'NEXT_STATIC_GEN_BAILOUT',
digest: '2705271876'
} Is there any way to make it work without "requestLocale"? Thank you very much for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You're probably looking for this: Static rendering. It's currently unfortunately a bit more cumbersome to set up than I'd like, but a simpler solution should be available in the near future—I hope to have more to share on this soon! |
Beta Was this translation helpful? Give feedback.
-
I followed this page: This page on NextJS is also very helpful: https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config Thanks @amannn for you help, we answered at the same time! |
Beta Was this translation helpful? Give feedback.
You're probably looking for this: Static rendering.
It's currently unfortunately a bit more cumbersome to set up than I'd like, but a simpler solution should be available in the near future—I hope to have more to share on this soon!