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

PPR: A required root parameter (locale) was not provided in generateStaticParams for /[locale] #1618

Open
3 tasks done
DiPSoMaNiE opened this issue Dec 18, 2024 · 1 comment
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@DiPSoMaNiE
Copy link

DiPSoMaNiE commented Dec 18, 2024

Description

Starting from [email protected] with experimental ppr enabled and use of setRequestLocale, I get the following error:

Error: A required root parameter (locale) was not provided in generateStaticParams for /[locale], please provide at least one value.

This error happened while generating the page. Any console logs will be displayed in the terminal window.
validateParams
node_modules/next/src/build/static-paths/app.ts (187:15)
validateParams
node_modules/next/src/build/static-paths/app.ts (512:7)

The error also occurs on [email protected] and [email protected] but everything works fine on [email protected].

Not knowing if it's a next-intl or a next issue, I'm reporting this in case it is an upcoming breaking change from next.

Verifications

Mandatory reproduction URL

https://github.com/DiPSoMaNiE/next-intl-bug-repro-app-router

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. Run bun run dev (or install / run dev with another package manager)
  3. Visit http://localhost:3000 and see error

Expected behaviour

Should not get any error.

@DiPSoMaNiE DiPSoMaNiE added bug Something isn't working unconfirmed Needs triage. labels Dec 18, 2024
@amannn
Copy link
Owner

amannn commented Dec 18, 2024

Thanks for the report! I think that's related to the upcoming rootParams API, which should make setRequestLocale obsolete. I've got an experimental PR open here that explores these upcoming features: #1531. It's still a bit early with these APIs, I'm currently investigating how these can be adopted. I hopefully have more to share on this soon!

Have you tried adding generateStaticParams as mentioned in the error message?

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

2 participants