sveltejs / svelte · Issue No. 18799
I've been getting random Uncaught TypeError: can't access property "increment", batch is null errors, I have no idea how that happens, my best guess is that an async component was mounted or destroyed while another update was still being processed, I can’t confirm the exact action that caused it so I tried to slop distill a reproduction and codex found a reproduction that reliably gets me the same error. My app extensively uses mount api to launch modals that use async inside so that can be related somehow.
This fails on Svelte 5.57.0, #18558, and #18726.
<!-- Child.svelte -->
<script>
const value = $derived(await Promise.resolve('child'));
</script>
<p data-child>{value}</p>
<!-- Main.svelte -->
<script>
import Child from './Child.svelte';
let anchor;
let run = $state(false);
$effect(() => {
if (run && anchor) Child(anchor, {});
});
</script>
<button onclick={() => (run = !run)}>run</button>
<span bind:this={anchor}></span>
Uncaught TypeError: can't access property "increment", batch is null
in $effect
in App.svelte
in __wrapper.svelte
in undefined
N/A
annoyance
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.