-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Query params are not available within load
function with adapter-vercel
#631
Comments
adapter-vercel
adapter-vercel
adapter-vercel
load
function with adapter-vercel
load
function with adapter-vercel
load
function with adapter-vercel
Possible duplicate #586 To get the value of a query param, you need to use |
I know and I did that - for sake of simplicity, I removed all that to make the example smaller - maybe not the best idea 😅 Here is a slightly longer case: <script context="module">
import { writable } from "svelte/store";
export async function load({ page }) {
const { query } = page;
const q = query.get("q") || "";
console.log("load", { page })
return {
props: {
q: writable(q),
s: q,
t: "I am a string",
w: writable("Writable here 👋")
},
};
}
</script>
<script>
import { onMount } from "svelte";
import { page } from "$app/stores";
export let q = writable("");
export let t = "";
export let s = "";
export let w = writable("");
console.log($page)
onMount(async () => {
console.log("---");
console.log($q);
console.log(t);
console.log(s);
console.log($w);
console.log("---");
console.log($page)
});
</script>
<div>s: {s}</div>
<div>q: {$q}</div>
<div>t: {t}</div>
<div>w: {$w}</div> Here is a slightly longer example, I expect an output like this for
but s and q are empty when using the Example: https://sveltekit-vercel.vercel.app/queryparams?q=pizza |
Describe the bug
It looks like that with
adapter-vercel
the query params within the load function are not available:Logs
Vercel function log
To Reproduce
I'm assuming vercel-cli is installed and user is logged in
Expected behavior
Query parameters should be available
Information about your SvelteKit Installation:
Severity
The behavior is different to
adapter-node
The text was updated successfully, but these errors were encountered: