Next.js Discord

Discord Forum

App Router + next-intl: locale is undefined in layout.js when calling getMessages(locale)

Unanswered
Beagle-Harrier posted this in #help-forum
Open in Discord
Beagle-HarrierOP
Hi everyone! I'm using Next.js App Router with next-intl and I'm running into a blocking error when trying to use getMessages(locale) inside my [locale]/layout.js.

---

### Error
When I access any locale page (e.g. /en, /pt), I get this:
Invalid or missing locale in getMessages: undefined

This error comes from my getMessages function in i18n/request.js:

0 Replies