sveltejs / sveltejs/kit

derived_inert warning with unfinished remote function

Open
#15,841 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

Async + remote functions

In reproduction repo there is cars page with a simple remote function call.

This function is delayed by 3 seconds. If I go to other page while the remote function is not finished, I get derived_inert warnings.

Quick recording:

https://github.com/user-attachments/assets/59fa37f7-b74c-41a0-93da-b0a635e3259a

Reproduction

https://github.com/vladshcherbin/svelte-kit-rf-bugs

Logs
<details>
 <summary>Browser Log</summary>

[svelte] derived_inert  client.js?v=89ae070d:3356
Reading a derived belonging to a now-destroyed effect may result in stale values
https://svelte.dev/e/derived_inert
warn @ client.js?v=89ae070d:3356
derived_inert @ warnings-Cm7Lh8j-.js?v=89ae070d:46
execute_derived @ runtime-CHnyNzb0.js?v=89ae070d:3371
update_derived @ runtime-CHnyNzb0.js?v=89ae070d:3397
get @ runtime-CHnyNzb0.js?v=89ae070d:5077
(anonymous) @ query.svelte.js?v=89ae070d:107
Promise.then
(anonymous) @ query.svelte.js?v=89ae070d:107
setTimeout
(anonymous) @ client.js?v=89ae070d:2732
requestAnimationFrame
navigate.type @ client.js?v=89ae070d:2731
(anonymous) @ client.js?v=89ae070d:2730

</details>
System Info
System:
    OS: macOS 15.7.5
  Binaries:
    Node: 26.1.0 - /Users/shcherbin/.local/state/fnm_multishells/17968_1778803213963/bin/node
    pnpm: 11.1.2 - /Users/shcherbin/.local/state/fnm_multishells/17968_1778803213963/bin/pnpm
  Browsers:
    Chrome: 148.0.7778.168
  npmPackages:
    @sveltejs/adapter-node: ^5.5.4 => 5.5.4
    @sveltejs/kit: ^2.60.1 => 2.60.1
    svelte: ^5.55.7 => 5.55.7
    vite: ^8.0.7 => 8.0.12
Severity

blocking an upgrade

Additional Information

[!IMPORTANT]
Additionally on page change unfinished remote function is not terminated and if I come back to page the new one takes more time to finish (e.g. 5s instead of 3s).

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 reproduction repository and its src/routes/cars/+page.svelte page, then reproduce the delayed remote-function call while navigating away. Use the browser log and the query.svelte.js/client.js stack references to trace the warning and unfinished request; done means navigation no longer produces derived_inert warnings and the abandoned request is terminated.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.