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
warn - Latest canary version not detected, detected: "12.1.0", newest: "12.3.1-canary.3".
Please try the latest canary version (npm install next@canary) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
NextJS router wrongly uses startsWith to see whether a link is running on the same origin or not. This fails when your site is running on example.com, but you push to example.com.br for a Portugese version of your site.
Expected Behavior
Site is running on example.com, example.fr and example.com.br
Example.com calls router.push('https://example.fr'), which works just fine.
Example.com calls router.push('https://example.com.br/portugese-page'), which opens example.com/.br/portugese-page instead.
The minimal example illustrates the problem, but does not reproduce it on localhost as the port number is also taken into account ( and so you cant have localhost:3000 and localhost.com:3000 ).
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.
Verify canary release
Provide environment information
/bin/sh: 1: yarn: not found
/bin/sh: 1: pnpm: not found
warn - Latest canary version not detected, detected: "12.1.0", newest: "12.3.1-canary.3".
Please try the latest canary version (
npm install next@canary
) to confirm the issue still exists before creating a new issue.Read more - https://nextjs.org/docs/messages/opening-an-issue
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
NextJS router wrongly uses
startsWith
to see whether a link is running on the same origin or not. This fails when your site is running on example.com, but you push to example.com.br for a Portugese version of your site.Expected Behavior
Site is running on example.com, example.fr and example.com.br
Example.com calls
router.push('https://example.fr')
, which works just fine.Example.com calls
router.push('https://example.com.br/portugese-page')
, which opensexample.com/.br/portugese-page
instead.Link to reproduction
https://github.com/ReinoutStevens/nextjs-router
To Reproduce
The minimal example illustrates the problem, but does not reproduce it on localhost as the port number is also taken into account ( and so you cant have localhost:3000 and localhost.com:3000 ).
The text was updated successfully, but these errors were encountered: