Remote Functions: Nested routes resolve incorrectly on redirect
Nobody has claimed this yet.
- 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
- Clone the repro
git clone https://github.com/AdrianGonz97/broken-nested-route-navigation.gitor visit the StackBlitz repro - Run
pnpm installandpnpm dev - Navigate to the root page and click
Go to Login Page - Press
Login(this should navigate the page to/nested/foo/bar) - Refresh the page (on StackBlitz, right click in the iframe preview and press
Reload frameinstead) - Press
Logout(note how the page navigates to/nested/foo/logininstead 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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