-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Description
Describe the bug
While developing with Svelte 5, an infinite loop occurred due to using $state inside $effect.
When clicking the button in the example, the console in the developer tools logs multiple times before throwing the 'effect_update_depth_exceeded' error.
The issue occurs when both No.1 and No.2 are present, but if either one is commented out, the infinite loop does not happen.
Is this a bug in Svelte 5?
If it's not a bug, I would like to understand why the reactivity of b is triggered, causing the infinite loop.
Reproduction
Logs
System Info
svelte 5.20
sveltejs/kit 2.17.0
sveltestrap 7.1.0Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels