diff --git a/packages/svelte-db/src/useLiveQuery.svelte.ts b/packages/svelte-db/src/useLiveQuery.svelte.ts index 436112b5f..de18afd08 100644 --- a/packages/svelte-db/src/useLiveQuery.svelte.ts +++ b/packages/svelte-db/src/useLiveQuery.svelte.ts @@ -392,6 +392,9 @@ export function useLiveQuery( // Subscribe to collection changes with granular updates const subscription = currentCollection.subscribeChanges( (changes: Array>) => { + // avoids state_unsafe_mutation + await tick() + // Apply each change individually to the reactive state untrack(() => { for (const change of changes) {