Skip to content
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

Fix query params being empty #774

Merged
merged 2 commits into from
Mar 31, 2021

Conversation

wiesson
Copy link
Contributor

@wiesson wiesson commented Mar 30, 2021

Fixes #631

The query params are not parsed correctly, because URL does not return query - instead it returns the desired searchParams!

Tested here - https://sveltekit-vercel.vercel.app/queryparams?q=pizza

@wiesson wiesson force-pushed the fix/vercel-adapter-query-params branch from 4578449 to 03d67ac Compare March 30, 2021 14:42
@wiesson
Copy link
Contributor Author

wiesson commented Mar 30, 2021

The previous job was successful, I could imagine that somekind of race condition happened because I force pushed to the branch 🤷‍♂️

https://github.com/sveltejs/kit/actions/runs/701770695

@benmccann
Copy link
Member

If this is broken, then I'm guessing adapter-node might be as well:

query: new URLSearchParams(parsed.query || '')

Strange that this would only be reported now...

@benmccann
Copy link
Member

Ah, nevermind. adapter-node calls parse which returns a legacy URL which defines query. We should probably change adapter-node as well so that it doesn't use the legacy URL creation method

@wiesson
Copy link
Contributor Author

wiesson commented Mar 31, 2021

Should I include that in this PR as well or create a new one?

@benmccann benmccann force-pushed the fix/vercel-adapter-query-params branch 2 times, most recently from 168b850 to e536fa9 Compare March 31, 2021 16:26
@benmccann benmccann force-pushed the fix/vercel-adapter-query-params branch from e536fa9 to 7c1cef4 Compare March 31, 2021 16:27
@benmccann
Copy link
Member

I've updated this PR

@benmccann benmccann merged commit ca33a35 into sveltejs:master Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query params are not available within load function with adapter-vercel
3 participants