-
Notifications
You must be signed in to change notification settings - Fork 257
getQuery() empty on Vercel #1020
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
Comments
Cannot reproduce. You may check this example as described here: https://github.com/kricsleo/repro-h3-1020/blob/main/server/routes/api/foo/%5Bpath%5D/test.ts And the deployed API endpoint: https://repro-h3-1020.vercel.app/api/foo/e9cb0344-3bf3-44f6-8d90-c620a638be48/test?name=drew It works fine, returning Could you share more details? (A StackBlitz example or GitHub repo would be ideal) 🙏 |
OK, so I figured this out. It was due to a Vercel and Nuxt (using Nitro) caching not playing well together:
When the commented out code was on, |
Possibly related to nitrojs/nitro#1880 You may try this: routeRules: {
// "/**" won't work with ISR
// '/**': {
// isr: true
// },
// "/*" works
'/api/foo/*/test': {
isr: true
}
}, It's odd, though. |
Environment
I have a Nuxt install, using the built in Nitro with some custom endpoints located in
/server/routes/api
. I am usingdefineCachedEventHandler
for them.Locally, getQuery() returns what you'd expect, but when deployed to Vercel, it's empty.
URL like this:
https://example.vercel.app/api/foo/e9cb0344-3bf3-44f6-8d90-c620a638be48/test?name=drew
Vercel logs the "searchParam" in it's logger, but I can't get getQuery() to return anything. I'm very perplexed.
Reproduction
Describe the bug
getQuery() is empty on Vercel, but populated on local.
Additional context
Screenshot of the Vercel logs. Notice my console.log is all undefined, but the SearchParams are populated in this case with a test of writers=9).
Logs
The text was updated successfully, but these errors were encountered: