use app router without i18n routing get an error when build #1325
Replies: 3 comments 1 reply
-
Moving this to a discussion since this seems to be a usage question regarding Next.js itself. |
Beta Was this translation helpful? Give feedback.
-
In case it helps anyone else, I spent a while today tracking down this error - not from the example, but my own code. I was using const t = await getTranslations('whatever'); in the outer scope of my layout.tsx for metadata. You can't do this, because any call to getTranslations relies on the request scope being there for the call to Instead, you must use a |
Beta Was this translation helpful? Give feedback.
-
I'm getting this error, trying to reproduce the issue with missing RSC payload (#1246) https://stackblitz.com/~/github.com/alexbuznik-stark/next-intl-demo-3 |
Beta Was this translation helpful? Give feedback.
-
Description
use this example
https://github.com/amannn/next-intl/blob/main/examples/example-app-router-without-i18n-routing/src/i18n/request.ts
Error:
headers
was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-contextVerifications
Mandatory reproduction URL
Reproduction description
Steps to reproduce:
Expected behaviour
not error
Beta Was this translation helpful? Give feedback.
All reactions