Minimal reproduction for a scheduler deadlock regression in Svelte 5.53.8.
A store getter that lazily writes $state on first read deadlocks the Svelte scheduler when that getter is read inside a template binding during the flush/commit phase. The UI freezes permanently — no errors in console, no stack overflow, no crash.
- Affects: Svelte 5.53.8, 5.53.9 (and presumably later)
- Works in: Svelte 5.53.7
- Likely cause: PR #17805 "simplify scheduling logic"
npm install
npm run dev- Click "Open panel" — the panel opens, showing width info
- Click "Counter" — the counter does not update. The UI is frozen.
- No errors in the console. The scheduler is silently deadlocked.
Change svelte to 5.53.7 in package.json, reinstall, repeat — everything works.
The store.svelte.js exports a getter that writes $state on first read:
get panelWidth () {
if (panelWidth === null) panelWidth = DEFAULT_WIDTH // writes $state!
return panelWidth
}When this getter is read during the commit phase (via a style:width binding), the $state mutation stalls the scheduler in 5.53.8+.
Use nullish coalescing instead of assignment:
get panelWidth () {
return panelWidth ?? DEFAULT_WIDTH // no state write
}