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.
npm install
npm run dev
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
}