Describe the bug
I’m using SvelteKit with both kit.experimental.remoteFunctions and kit.experimental.handleRenderingErrors enabled.
When a remote query throws an error(404, ...) during component render on a client-rendered page, the nearest +error.svelte renders as expected for that route. However, after navigating client-side to another route, the failed error UI is not torn down correctly and remains mounted above the next page’s content.
This minimal repro has two routes:
/ renders a normal home page with a link to /data
/data awaits a remote query at the top level of +page.svelte
The remote query throws:
error(404, "There's no data here");
Reproduction
https://github.com/tudor-cel-stan/sveltekit-error-page-navigation-repro
Steps:
bun install
bun run dev
- Open
/
- Click
Go to error page
- Confirm the error page renders for
/data
- Click
Click this to see the issue
- Observe that
/ renders, but the old error page remains mounted above the home page content
Relevant files in the repro:
src/routes/data.remote.ts
src/routes/data/+page.svelte
src/routes/+error.svelte
src/routes/+page.svelte
svelte.config.js
Logs
Browser console:
- No especially useful client error is emitted in the repro
- The issue is primarily visible in the rendered DOM: the old `+error.svelte` remains mounted after navigation
Server logs:
- Only the expected 404 caused by the remote query throwing `error(404, "There's no data here")`
- No additional server-side crash or fatal exception
System Info
System:
OS: macOS 26.3.1
CPU: (8) arm64 Apple M3
Memory: 1.24 GB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.13.0 - /Users/tudorcelstan/.nvm/versions/node/v24.13.0/bin/node
npm: 11.6.2 - /Users/tudorcelstan/.nvm/versions/node/v24.13.0/bin/npm
pnpm: 10.33.0 - /Users/tudorcelstan/Library/pnpm/pnpm
bun: 1.3.10 - /Users/tudorcelstan/.bun/bin/bun
Browsers:
Brave Browser: 145.1.87.190
Chrome: 146.0.7680.178
Safari: 26.3.1
npmPackages:
@sveltejs/adapter-auto: ^7.0.1 => 7.0.1
@sveltejs/kit: ^2.57.1 => 2.57.1
@sveltejs/vite-plugin-svelte: ^7.0.0 => 7.0.0
svelte: ^5.55.2 => 5.55.2
vite: ^8.0.8 => 8.0.8
Severity
annoyance
Additional Information
Related issues / nearby prior art I found:
I don’t think those exactly match this repro.
What seems distinct here is:
- the remote query error is caught and rendered
- client navigation to another route succeeds
- but the old failed route UI is still left mounted in the page
A full page reload clears the bad state.
A client-side internal navigation does not.
Describe the bug
I’m using SvelteKit with both
kit.experimental.remoteFunctionsandkit.experimental.handleRenderingErrorsenabled.When a remote query throws an
error(404, ...)during component render on a client-rendered page, the nearest+error.svelterenders as expected for that route. However, after navigating client-side to another route, the failed error UI is not torn down correctly and remains mounted above the next page’s content.This minimal repro has two routes:
/renders a normal home page with a link to/data/dataawaits a remote query at the top level of+page.svelteThe remote query throws:
Reproduction
https://github.com/tudor-cel-stan/sveltekit-error-page-navigation-repro
Steps:
bun installbun run dev/Go to error page/dataClick this to see the issue/renders, but the old error page remains mounted above the home page contentRelevant files in the repro:
src/routes/data.remote.tssrc/routes/data/+page.sveltesrc/routes/+error.sveltesrc/routes/+page.sveltesvelte.config.jsLogs
System Info
Severity
annoyance
Additional Information
Related issues / nearby prior art I found:
I don’t think those exactly match this repro.
What seems distinct here is:
A full page reload clears the bad state.
A client-side internal navigation does not.