Describe the bug
TanStack Svelte DB is incompatible with Svelte 5's async compiler option due to calling flushSync() inside an effect, which violates its reactivity constraints:
https://github.com/TanStack/db/blob/48b8e8fc08ba8b0589476b5fd294f44b09f8ce8c/packages/svelte-db/src/useLiveQuery.svelte.ts#L357
The bug that this triggers:
Uncaught Svelte error: flush_sync_in_effect Cannot use flushSync inside an effect
See https://svelte.dev/e/flush_sync_in_effect
To Reproduce
Steps to reproduce the behavior:
- Enable async compiler in
svelte.config.js
- Use
useLiveQuery in any component
- Navigate to the page → Error occurs during collection initialization
Desktop (please complete the following information):