You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Route param is undefined when +page.svelte is rendered.
Reproduction
experimental.async should be enabled.
Hover the first link then click the first button. This will add the key url query parameter with the value of value. Updating this query parameter will trigger the render of routes/[index]/+page.svelte even though there is no index. This behavior doesn't happen if the /?key=value link is hovered before the buttons are clicked.
routes/+page.svelte
<script>
import { goto } from"$app/navigation";
</script>
<ahref="/1">Navigate to /1</a>
<ahref="/?key=value">Navigate to /?key=value</a>
<buttononclick={() => {
goto("/?key=value", {
replaceState: true,
})
}}>
Go to /?key=value
</button>
<buttononclick={() => {
goto("/", {
replaceState: true,
})
}}>
Go to /
</button>
Describe the bug
Svelte.Params.error.mp4
Route param is undefined when
+page.svelteis rendered.Reproduction
experimental.asyncshould be enabled.Hover the first link then click the first button. This will add the
keyurl query parameter with the value ofvalue. Updating this query parameter will trigger the render ofroutes/[index]/+page.svelteeven though there is no index. This behavior doesn't happen if the/?key=valuelink is hovered before the buttons are clicked.routes/+page.svelteroutes/[index]/+page.svelteLogs
+page.svelte:10 {name: 'index', index: '1', url: 'http://localhost:5000/1'} +page.svelte:10 {name: 'index', index: undefined, url: 'http://localhost:5000/'} +page.svelte:10 {name: 'index', index: undefined, url: 'http://localhost:5000/?key=value'}System Info
System: OS: Linux 6.6 Arch Linux CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz Memory: 7.69 GB / 15.57 GB Container: Yes Shell: 5.2.37 - /usr/bin/bash Binaries: Node: 22.17.0 - /home/tpetrov/.nvm/versions/node/v22.17.0/bin/node npm: 10.9.2 - /home/tpetrov/.nvm/versions/node/v22.17.0/bin/npm pnpm: 10.24.0 - /home/tpetrov/.local/share/pnpm/pnpm bun: 1.3.2 - /home/tpetrov/.bun/bin/bun npmPackages: @sveltejs/adapter-auto: ^7.0.0 => 7.0.0 @sveltejs/kit: ^2.49.1 => 2.49.2 @sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1 svelte: ^5.45.8 => 5.45.8 vite: ^7.2.6 => 7.3.0Severity
serious, but I can work around it
Additional Information
No response