fix: never mark a child effect root as inert
#18111
Closing issue
Describe the bug
I got a bunch of this warning when updated Svelte to 5.55.3. This is caused by some weird interactions between a couple of shadcn-svelte, bits-ui, svelte-sonner components and page.url. Created a reproduction as requested by @dummdidumm.
Reproduction
Logs
[svelte] derived_inert Reading a derived belonging to a now-destroyed effect may result in stale values
System Info
[email protected]
[email protected]
Severity
annoyance
Pull request
A nested $effect.root was marked INERT during pause_children, which caused it to stay in that state indefinetly after the rest of the parent tree was destroyed. Consequently deriveds inside no longer update and cause warnings.
This fixes it by not marking nested $effect.roots as inert, just like nested $effect.roots are not destryoed and instead become a new root.
Fixes #18097
Info
🦋 Changeset detected
Latest commit: 4d0ba42
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| svelte | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
pnpm add https://pkg.pr.new/svelte@18111A nested `$effect.root` was marked `INERT` during `pause_children`, which caused it to stay in that state indefinetly after the rest of the parent tree was destroyed. Consequently deriveds inside no longer update and cause warnings. This fixes it by not marking nested `$effect.root`s as inert, just like nested `$effect.root`s are not destryoed and instead become a new root. Fixes #18097