Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of next-intl APIs in Server Components currently opts into dynamic rendering during build in not-found page #1359

Open
3 tasks done
tiavina-mika opened this issue Sep 21, 2024 · 0 comments
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@tiavina-mika
Copy link

tiavina-mika commented Sep 21, 2024

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 }));
};

Verifications

  • I've verified that the problem I'm experiencing isn't covered in the docs.
  • I've searched for similar, existing issues on GitHub and Stack Overflow.
  • I've compared my app to a working example to look for differences.

Mandatory 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

@tiavina-mika tiavina-mika added bug Something isn't working unconfirmed Needs triage. labels Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

1 participant