Skip to content

Redirects inside remote function queries not working as expected #16613

@pixelmund

Description

@pixelmund

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

Stackblitz

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

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions