Using NextIntlClientProvider always renders 404

50 Views Asked by At

I do not know how to describe this. In the app/[locale]/layout.tsx, placing <NextIntlClientProvider locale={locale} messages={messages}>{children}</NextIntlClientProvider> always causes the not-found page to be displayed.

Removing NextIntlClientProvider renders the page (though it breaks because useTranslations complains that no NextIntlClientProvider was provided).

Both locale and messages are valid; locale match the locales inside middleware.ts and next.config.js, and messages contains all expected strings.

The onError prop for NextIntlClientProvider does not get called at all, and there are no output to the console.

What is causing this? How to debug?

NOTE: this is using Next.js 14.1.3 App Router.

0

There are 0 best solutions below