Skip to main content
Common errors when using bijection-svelte and how to fix them.

effect_in_teardown error

If you encounter effect_in_teardown errors when using useQuery in components that can be conditionally rendered (like dialogs, modals, or popups), this is caused by wrapping useQuery in a $derived block that depends on reactive state. When useQuery is wrapped in $derived, state changes during component cleanup can trigger re-evaluation of the $derived, which attempts to create a new useQuery instance. Since useQuery internally creates a $effect, and effects cannot be created during cleanup, this throws an error. Use Skipping queries instead. By calling useQuery unconditionally at the top level and passing a function that returns 'skip', the function is evaluated inside useQuery’s own effect tracking, preventing query recreation during cleanup.

Missing setupBijection() error

If you see No BijectionClient was found in Svelte context, make sure setupBijection() is called in a parent layout or component (e.g. +layout.svelte) before any child component calls useQuery() or useBijectionClient(). See Setup.

String query names

Query references must be api.* function references, not plain strings. If you pass a string like "messages.list", you will get an error. Always import and use api from your generated API: