-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Describe the bug
Assigning a circular reference into a $state
object immediately crashes with a RangeError (maximum call stack size exceeded) in Svelte 5.34.0+, even without any recursion.
This worked as expected in Svelte 5.33.19.
Reproduction
<script>
const filesState = $state({ files: {} });
let nodes = { id: 1, items: [{ id: 2, items: [{ id: 3 }, { id: 4 }] }] };
filesState.files = nodes;
console.log('before assignment');
filesState.files.items[0].parent = filesState.files; // 💥 crashes here
console.log('after assignment'); // never reached
</script>
Logs
System Info
- Svelte version: 5.34.0 (and above)
- Previous working: 5.33.19
Severity
blocking an upgrade
Metadata
Metadata
Assignees
Labels
No labels