You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start the application in development (pnpm run dev) in default language http://localhost:3000.
Hover on the "Locale switcher" links, notice urls end in a slash as in http://localhost:3000/fr/
Hover on the other links, notice they don't end in a slash, as in http://localhost:3000/gsp/first
Click on any of the "To XXXXX page" link except "To Index page").
Hover on any of the "Locale switcher" links, notice urls do not end in a slash.
Visit french home page at http://localhost:3000/fr. Notice link to english do not contain trailing slash, but german does.
Current vs. Expected behavior
In steps 2 and 6, I would expect the "Locale switcher" links to not end in a slash, as any other link in the page or its sub-pages.
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11)
Available memory (MB): 15691
Available CPU cores: 16
Binaries:
Node: 18.20.2
npm: 10.5.0
Yarn: 1.22.19
pnpm: 8.15.7
Relevant Packages:
next: 14.2.2 // Latest available version is detected (14.2.2).
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 4.9.5
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Internationalization (i18n)
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
The code in the repo is exactly the same as the next-i18n example, just adding this line to nextConfig:
skipTrailingSlashRedirect: true,
Any link to the home page in a language other than default gets a slash appended. This behaviour does not happen when linking to other pages.
In addition to this, when adding a rewrites section to nextConfig or adding an empty middleware and visiting the translated home page at http://localhost:3000/fr, a slash is also appended to the URL. It's not a redirect, its just appended after the page load.
The "empty-middleware" and "rewrites" branches in the same repo reflect this issue, which is also triggered by adding skipTrailingSlashRedirect: true, to nextConfig
The text was updated successfully, but these errors were encountered:
Link to the code that reproduces this issue
https://github.com/marcorcau/next-i18n-routing
To Reproduce
Test URL: https://next-i18n-routing-lac.vercel.app
http://localhost:3000
.http://localhost:3000/fr/
http://localhost:3000/gsp/first
http://localhost:3000/fr
. Notice link to english do not contain trailing slash, but german does.Current vs. Expected behavior
In steps 2 and 6, I would expect the "Locale switcher" links to not end in a slash, as any other link in the page or its sub-pages.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) Available memory (MB): 15691 Available CPU cores: 16 Binaries: Node: 18.20.2 npm: 10.5.0 Yarn: 1.22.19 pnpm: 8.15.7 Relevant Packages: next: 14.2.2 // Latest available version is detected (14.2.2). eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.5 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Internationalization (i18n)
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
The code in the repo is exactly the same as the
next-i18n
example, just adding this line tonextConfig
:Any link to the home page in a language other than default gets a slash appended. This behaviour does not happen when linking to other pages.
In addition to this, when adding a
rewrites
section tonextConfig
or adding an emptymiddleware
and visiting the translated home page athttp://localhost:3000/fr
, a slash is also appended to the URL. It's not a redirect, its just appended after the page load.The "empty-middleware" and "rewrites" branches in the same repo reflect this issue, which is also triggered by adding
skipTrailingSlashRedirect: true,
to nextConfigThe text was updated successfully, but these errors were encountered: