> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Fixes for common bijection-svelte errors: effect_in_teardown, missing setupBijection(), and string query names.

Common errors when using [`bijection-svelte`](/client/svelte/overview) 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](/client/svelte/reactivity#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](/client/svelte/overview#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:

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
import { api } from "../bijection/_generated/api.js";
```
