-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
In specific cases, involving async and remote functions (see reproduction), Svelte throws an error:
TypeError: Can't access property "increment", batch is null
Reproduction
https://stackblitz.com/edit/svelte-await-null-batch-repro?file=src%2Froutes%2F%2Bpage.svelte
Open the preview in new tab, so that you can see console errors. Click the „OK” button in any row, then click „Verify next one”.
Found a simpler reproduction that doesn't involve SvelteKit: https://svelte.dev/playground/bc31c16761ea4fabbaf8634c62d0698f?version=5.38.0.
Logs
Uncaught (in promise) TypeError: can't access property "increment", batch is null
async_derived deriveds.js:139
update_reaction runtime.js:287
update_effect runtime.js:467
create_effect effects.js:125
async_effect effects.js:338
async_derived deriveds.js:118
$$body Form.svelte:11
Form Form.svelte:94
effect2 hmr.js:47
update_reaction runtime.js:287
update_effect runtime.js:467
create_effect effects.js:125
branch effects.js:377
wrapper hmr.js:38
update_reaction runtime.js:287
update_effect runtime.js:467
create_effect effects.js:125
block effects.js:365
wrapper hmr.js:28
alternate +page.svelte:32
add_svelte_meta context.js:49
alternate +page.svelte:32
alternate_effect if.js:115
update_reaction runtime.js:287
update_effect runtime.js:467
create_effect effects.js:125
branch effects.js:377
update_branch if.js:115
set_branch if.js:48
_page +page.svelte:7
if_block if.js:140
update_reaction runtime.js:287
update_effect runtime.js:467
#traverse_effect_tree batch.js:305
process batch.js:212
flush_effects batch.js:561
flush batch.js:381
ensure batch.js:460
dequeue batch.js:69
enqueue batch.js:471
ensure batch.js:454
internal_set sources.js:182
set sources.js:161
on_click +page.svelte:9
handle_event_propagation events.js:263System Info
(StackBlitz container)
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
svelte: ^5.38 => 5.38.0Severity
blocking all usage of svelte
dangodai, Sendouc and whalderman
Metadata
Metadata
Assignees
Labels
No labels