Closed as duplicate of#1880
Description
Environment
I have a Nuxt install, using the built in Nitro with some custom endpoints located in /server/routes/api
. I am using defineCachedEventHandler
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
export default defineCachedEventHandler(async (event) => {
return getQuery(event)
},
{
maxAge: 31_536_000 // 1 year
})
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).