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
When using redirectreturned from createLocalizedPathnamesNavigation with localePrefix: 'as-needed', in the middleware, then the locale is always added to the url which it should not. It should never be added on the default locale.
This seems like a bug.
Unfortunately, the reproduction is missing or incomplete, and as such we cannot investigate this issue. Please add a reproduction to the issue, otherwise it will be closed automatically.
To help us resolve the issue quickly, please simplify the reproduction as much as possible by removing any unnecessary code, files, and dependencies that are not directly related to the problem. The easier it is for us to see the issue, the faster we can help you.
Apart from the reproduction, make sure to include the precise steps on how to reproduce the issue, e.g.:
Open reproduction
Click on …
See error: …
Thank you for your understanding!
FAQ
"I've included a reproduction, what is missing?"
This comment might have been added because your reproduction doesn't point to either a CodeSandbox or a public GitHub repository where the issue can be reproduced.
Please make sure:
If you've linked to a CodeSandbox, make sure to save the latest changes.
If you've linked to a GitHub repository, make sure that you've committed and pushed the latest changes.
Linking to other resources, e.g. to the docs, unfortunately doesn't help to reproduce your issue.
This issue has been automatically closed because it is missing a reproduction and there hasn't been any activity for 7 days. If the problem persists, please create a new bug report.
Description
When using
redirect
returned fromcreateLocalizedPathnamesNavigation
withlocalePrefix: 'as-needed',
in the middleware, then the locale is always added to the url which it should not. It should never be added on the default locale.This seems like a bug.
I tried to create a codeSandbox, but it seems like the button calling the server actions never fires because of something with codesandbox.
Mandatory reproduction URL (CodeSandbox or GitHub repository)
https://codesandbox.io/p/sandbox/next-intl-bug-template-app-forked-cw69w9?file=%2Fsrc%2Fapp%2F%5Blocale%5D%2Faction.ts%3A1%2C1
Reproduction description
Click the button that calls the redirect function.
Expected behaviour
There should not be a locale in the url after redirect if you are on EN locale
The text was updated successfully, but these errors were encountered: