-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
In the SvelteKit docs, it’s stated that redirects should work inside query functions. However, when I trigger a redirect within a query, the navigation happens, but the pending state persists — the UI continues to show the loading snippet instead of rendering the new page’s content. This gives the impression that the page is stuck in a loading state, even though the redirect has occurred.
Expected behavior: After a redirect from a query, the new page should render immediately, just like with redirects in load functions.
Reproduction
Logs
Uncaught (in promise) Redirect {status: 307, location: '/about'}
System Info
From Stackblitz:
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@sveltejs/adapter-auto: ^6.0.0 => 6.1.0
@sveltejs/kit: ^2.28.0 => 2.28.0
@sveltejs/vite-plugin-svelte: ^6.0.0 => 6.1.1
svelte: ^5.38.1 => 5.38.1
vite: ^7.0.4 => 7.1.2
Severity
blocking an upgrade
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels