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

[10.0.0][i18n][notFound][Vercel] undefined locale and locales in getStaticProps on custom 404-page #18505

Closed
rokinsky opened this issue Oct 29, 2020 · 1 comment · Fixed by #18513
Assignees
Milestone

Comments

@rokinsky
Copy link
Contributor

rokinsky commented Oct 29, 2020

Bug report

Describe the bug

I use the notFound and i18n features on SSG pages with enabled fallback (blocking strategy). Variables locale and locales are undefined in getStaticProps context when notFound occurs. This happens only when an app is deployed to Vercel.

To Reproduce

Repository: next.js-bug-i18n-not-found
Steps to reproduce the behavior:

  1. Deploy the app to Vercel
  2. Go to the website, e.g. https://next-js-bug-i18n-not-found.vercel.app
  3. See
{
  "is404": true,
  "locale": "",
  "locales": []
}

Expected behavior

Displaying

{
  "is404": true,
  "locale": "en",
  "locales": [
    "en",
    "nl-nl",
    "de-de"
  ]
}

Screenshots

N/A

System information

  • OS: macOS
  • Browser (if applies): chrome
  • Version of Next.js: 10.0.0
  • Version of Node.js: v10.22.1

Additional context

Works fine locally in dev and prod modes.

@timneutkens timneutkens added this to the iteration 11 milestone Oct 29, 2020
@ijjk ijjk added the point: 2 label Oct 30, 2020
@ijjk ijjk self-assigned this Oct 30, 2020
@kodiakhq kodiakhq bot closed this as completed in #18513 Oct 30, 2020
kodiakhq bot pushed a commit that referenced this issue Oct 30, 2020
This ensures we provide the current `locale`, `locales`, and `defaultLocale` in the context when rendering the 404 for a blocking SSG page

Fixes: #18505
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants