-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
[9.5] optional catch all routes req.query.params behavior is different when deployed on vercel (works in dev, works in 9.4.4) #15579
Comments
Does |
I have a similar issue. If I build it locally and run it with |
I have a possibly related issue for a monorepo setup after upgrading to 9.5. I think it has to do with the routes in now.json not working correctly. I have this; {
...
"builds": [{ "src": "brand/next.config.js", "use": "@now/next" }],
"routes": [{ "src": "/(.*)", "dest": "/brand/$1", "continue": true }]
} Everything works in development, but on vercel my APIs fail and the homepage gets redirected to /brand. Please let me know what you need from me or if this should be a separate issue. |
This updates collecting dynamic route params on Vercel to make sure that missing optional dynamic routes are undefined. Additional tests for this mode have also been added to ensure the params are being collected properly Closes: #15579
This was just fixed in 9.5.1, please upgrade! |
I confirm this fixed my issue. Thanks |
My issue appears to be resolved with the patch as well. Appreciate the quick fix! |
This updates collecting dynamic route params on Vercel to make sure that missing optional dynamic routes are undefined. Additional tests for this mode have also been added to ensure the params are being collected properly Closes: vercel#15579
Hey there, this bug is back again today on Vercel. Without updating Next.js, req.query.params went from I created a ticket on Vercel side. Next.js version: 10.0.7 |
Hi @vvo, this has been fixed in the latest version of Next.js |
Thanks, I'll wait for full release and upgrade from there. For now I just switched from params === undefined to !params :) |
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. |
Bug report
Describe the bug
Hi, just tried to upgrade from 9.4.4 to 9.5.0. I was previously using the experimental
optionalCatchAll
flag. On 9.5.0 my optional catch-all routes are working in dev mode (next dev) but no more working when deployed on Vercel.The issue is that req.query.params value is different between Vercel and dev mode when using optional catch-all routes.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Given a project structure of:
When calling
https://example.com/organizations/200/teams
on vercel (9.5.0):req.query.params
value:[""]
When calling
https://localhost/organizations/200/teams
onnext dev
(9.5.0):req.query.params
value:undefined
When calling
https://example.com/organizations/200/teams
on vercel (9.4.4):undefined
When calling
https://localhost/organizations/200/teams
onnext dev
(9.4.4):undefined
Expected behavior
Both vercel and
next dev
should send the same value for req.query.params, maybe sticking toundefined
or anything else that makes sense given current APIs.System information
Additional context
n/a
The text was updated successfully, but these errors were encountered: