1

Description

When I run yarn build, I get this error:


Error: Usage of next-intl APIs in Server Components currently opts into dynamic rendering. 
This limitation will eventually be lifted, but as a stopgap solution, you can use the `unstable_setRequestLocale` API to enable static rendering


Export encountered errors on following paths:
        /_not-found/page: /_not-found

As the doc suggests, I have 2 not-found files:

  • app/[locale]/not-found.tsx
  • app/not-found.tsx

I think the error comes from this:

// app/[locale]/layout.tsx
export const generateStaticParams = () => {
  return ["en"].map((locale: string) => ({ locale }));
};

Reproduction URL

https://codesandbox.io/p/github/tiavina-mika/next-intl-bug-repro-app-router

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. Open terminal
  3. Run yarn build
  4. See error in the console

Expected behaviour

The build should be ended successfully

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.