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

[i18n + redirects] defaultLocale was ignored #19403

Closed
deekay44 opened this issue Nov 21, 2020 · 2 comments · Fixed by #19766
Closed

[i18n + redirects] defaultLocale was ignored #19403

deekay44 opened this issue Nov 21, 2020 · 2 comments · Fixed by #19766
Assignees
Milestone

Comments

@deekay44
Copy link

Bug report

Describe the bug

defaultLocale was ingored in redirects with i18n.

i18n config: { locales: ['en', 'fr', 'zh'], defaultLocale: 'en' }
redirects config: { source: '/first-page', destination: '/second-page', permanent: true }

We will be redirected from /first-page to /en/second-page, for fr and zh locales redirect is correct.

To Reproduce

Described in the Describe the bug section.

Expected behavior

defaultLocale should be stripped from redirects.

System information

  • OS: Windows, Linux
  • Browser: Chrome
  • Version of Next.js: 10.0.3-canary.0
  • Version of Node.js: 12.16.1
  • Deployment: dev, next start, Vercel
@deekay44 deekay44 added the bug Issue was opened via the bug report template. label Nov 21, 2020
@deekay44 deekay44 changed the title [i18n] defaultLocale was ignored in redirects [i18n + redirects] defaultLocale was ignored in redirects Nov 21, 2020
@deekay44 deekay44 changed the title [i18n + redirects] defaultLocale was ignored in redirects [i18n + redirects] defaultLocale was ignored Nov 21, 2020
@timneutkens timneutkens added kind: bug and removed bug Issue was opened via the bug report template. labels Nov 23, 2020
@timneutkens timneutkens added this to the iteration 14 milestone Nov 23, 2020
@Timer Timer removed this from the iteration 14 milestone Nov 23, 2020
@deekay44
Copy link
Author

deekay44 commented Dec 1, 2020

Any info about this issue, this is very critical for i18+redirects usage?

@timneutkens timneutkens added this to the iteration 14 milestone Dec 2, 2020
@ijjk ijjk self-assigned this Dec 3, 2020
@ijjk ijjk added the point: 2 label Dec 3, 2020
@kodiakhq kodiakhq bot closed this as completed in #19766 Dec 4, 2020
kodiakhq bot pushed a commit that referenced this issue Dec 4, 2020
This ensures i81n custom routes are resolving correctly, it also corrects redirects for default locales when `locale: false` is not used, and this also simplifies the resolving for custom routes with i18n in `next-server` adding types for the i18n config. This also adds additional tests to prevent regression and starts leveraging a shared `NextConfig` type to allow us to share types for config values. 

Fixes: #19521
Fixes: #19403
Fixes: #19302
Fixes: #19227
@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.

5 participants