-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Description
Describe the bug
Since 5.43.3 there appears to be some kind of race condition where the rendered value in the boundary can be stale.
Bug seems to have been introduced by #17098
Reproduction
<script>
let foo = $state(1);
let bar = $state(false);
$effect(() => {
foo = 2;
bar = true;
});
async function stall() {
return new Promise(resolve => setTimeout(resolve, 0));
}
let baz = $derived(bar ? await stall() : null);
</script>
<p>Outside boundary value: {foo}</p>
<svelte:boundary>
{#snippet pending()}
<p>Loading</p>
{/snippet}
{@const quux = await stall()}
<p>Inside boundary value: {foo}</p>
</svelte:boundary>Logs
System Info
Svelte playgroundSeverity
blocking an upgrade
Metadata
Metadata
Assignees
Labels
No labels