Next.js Discord

Discord Forum

Localization & i18n with NextJS16

Unanswered
African Slender-snouted Crocodil… posted this in #help-forum
Open in Discord
African Slender-snouted CrocodileOP
I am trying the new version of NextJS and trying to use next-intl for i18n.

As understood from the conference, I want to try the new "use cache" paradigm, and I have my first issue.

The translations are stored in JSON files, and it is async to read that, so I get this error if I run my app:

"Uncached data was accessed outside of <Suspense>"

The problem comes from here:

export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { const messages = await getMessages(); // this is the problem return ( ... <NextIntlClientProvider messages={messages}> {children} </NextIntlClientProvider> ... ); }

My question is how can I handle correctly these translations correctly?

0 Replies