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
router.asPath contains dynamic path as query params in non default language on vercel. #34804
Comments
I believe you should use |
@xhoantran This isn't ideal solution. I want this to be crawlable by bots and and this leads to crawler's going to incorrect urls. Please suggest what can be done to make it correct on server. |
I've also noticed that when you use I wonder if it also affects locales? I suspect it'd end up looking like /index/nl or /nl/index or...? (12.1.0) Edit: I've now raised a bug for it #35345 |
Please verify that your issue can be recreated with Why was this issue marked with the
|
This issue has been automatically closed because it wasn't verified against next@canary. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
router.asPath
contains dynamic path as query params in non default language on vercel.Example -
Assume there is a page
[...search].js
.For path
/my-path
,router.asPath
returns/my-path
on server and/my-path
on client.For path
/nl/my-path
,router.asPath
returns/nl/my-path?search=my-path
on server and/my-path
on client.Only happens for non-default locale.
Only happens on vercel.
Expected Behavior
For path
/nl/my-path
,router.asPath
returns/my-path
To Reproduce
See the implementation here.
https://github.com/akshitkrnagpal/vercel-as-path-issue
Go to page https://vercel-as-path-issue.vercel.app/nl/my-path
You will see
asPath
as/my-path
asPath
in html. See image below.The text was updated successfully, but these errors were encountered: