sveltejs / sveltejs/kit

Remote Functions: Nested routes resolve incorrectly on redirect

Open
#16,273 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

router
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

This issue was first introduced in v2.65.1 where navigations from a nested route would resolve incorrectly when a redirect is thrown from a remote function.

e.g. navigating from /some/nested/route to /foo would resolve to /some/nested/foo

I'm guessing this PR #16014 may have been the one to introduce this bug.

Reproduction
  1. Clone the repro git clone https://github.com/AdrianGonz97/broken-nested-route-navigation.git or visit the StackBlitz repro
  2. Run pnpm install and pnpm dev
  3. Navigate to the root page and click Go to Login Page
  4. Press Login (this should navigate the page to /nested/foo/bar)
  5. Refresh the page (on StackBlitz, right click in the iframe preview and press Reload frame instead)
  6. Press Logout (note how the page navigates to /nested/foo/login instead of /login)
Logs

System Info
System:
    OS: Linux 6.8 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
    CPU: (20) x64 QEMU Virtual CPU version 2.5+
    Memory: 18.62 GB / 31.34 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 24.11.1 - /home/koala/.volta/tools/image/node/24.11.1/bin/node
    Yarn: 1.22.22 - /home/koala/.volta/tools/image/yarn/1.22.22/bin/yarn
    npm: 11.6.2 - /home/koala/.volta/tools/image/node/24.11.1/bin/npm
    pnpm: 10.33.4 - /home/koala/.volta/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^7.0.1 => 7.0.1 
    @sveltejs/kit: ^2.63.0 => 2.69.1 
    @sveltejs/vite-plugin-svelte: ^6.0.0 => 6.2.4 
    svelte: ^5.56.1 => 5.56.4 
    vite: ^7.0.0 => 7.3.6
Severity

blocking an upgrade

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked broken-nested-route-navigation reproduction: run pnpm install and pnpm dev, then follow the login and logout navigation steps. Trace the remote-function redirect from the nested route and add a regression check for the expected /login destination rather than /nested/foo/login.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.