# Error Codes

<!-- Generated by scripts/generate-error-docs.mjs. Do not edit by hand. -->

Production builds of TanStack DB shorten error messages to a code, the inputs
that the error can show, and a link to this page. For example:

```text
TanStack DB error 17 (key=1, collectionId="todos"): https://tanstack.com/db/latest/docs/errors#error-17
```

A console warning uses the same form with `warning` in place of `error`.
Development builds keep the full messages below. The error classes, their
`name` values, and their fields are the same in both builds. See
[Error Handling](./guides/error-handling.md) for how to catch them.

<a id="error-2"></a>

## Error 2: `DuplicateDbInstanceError`

Development builds show the full message. For example:

```text
Multiple instances of @tanstack/db detected!

This causes transaction context to be lost because each instance maintains its own transaction stack.

Common causes:
1. Different versions of @tanstack/db installed
2. Incompatible peer dependency versions in packages
3. Module resolution issues in bundler configuration

To fix:
1. Check installed versions: npm list @tanstack/db (or pnpm/yarn list)
2. Force a single version using package manager overrides:
   - npm: "overrides" in package.json
   - pnpm: "pnpm.overrides" in package.json
   - yarn: "resolutions" in package.json
3. Clear node_modules and lockfile, then reinstall

To temporarily disable this check (not recommended):
Set environment variable: TANSTACK_DB_DISABLE_DUP_CHECK=1

See: https://tanstack.com/db/latest/docs/troubleshooting#duplicate-instances
```

<a id="error-3"></a>

## Error 3: `InvalidSyncPersistenceCapabilityError`

Development builds show the full message. For example:

```text
Invalid sync persistence capability at metadata.persistence: reason. Custom sync wrappers must forward metadata.persistence unchanged.
```

<a id="error-4"></a>

## Error 4: `CollectionRequiresConfigError`

Development builds show the full message. For example:

```text
Collection requires a config
```

<a id="error-5"></a>

## Error 5: `CollectionRequiresSyncConfigError`

Development builds show the full message. For example:

```text
Collection requires a sync config
```

<a id="error-6"></a>

## Error 6: `InvalidSchemaError`

Development builds show the full message. For example:

```text
Schema must implement the standard-schema interface
```

<a id="error-7"></a>

## Error 7: `SchemaMustBeSynchronousError`

Development builds show the full message. For example:

```text
Schema validation must be synchronous
```

<a id="error-8"></a>

## Error 8: `CollectionInErrorStateError`

Development builds show the full message. For example:

```text
Cannot perform operation on collection "collection-1" - collection is in error state. Try calling cleanup() and restarting the collection.
```

<a id="error-9"></a>

## Error 9: `InvalidCollectionStatusTransitionError`

Development builds show the full message. For example:

```text
Invalid collection status transition from "pending" to "ready" for collection "collection-1"
```

<a id="error-10"></a>

## Error 10: `CollectionIsInErrorStateError`

Development builds show the full message. For example:

```text
Collection is in error state
```

<a id="error-11"></a>

## Error 11: `NegativeActiveSubscribersError`

Development builds show the full message. For example:

```text
Active subscribers count is negative - this should never happen
```

<a id="error-12"></a>

## Error 12: `LiveQueryObserverDisposedError`

Development builds show the full message. For example:

```text
Cannot subscribe to a disposed LiveQueryObserver
```

<a id="error-13"></a>

## Error 13: `LiveQueryWindowControllerDisposedError`

Development builds show the full message. For example:

```text
Cannot subscribe to a disposed LiveQueryWindowController
```

<a id="error-14"></a>

## Error 14: `UndefinedKeyError`

Development builds show the full message. For example:

```text
An object was created without a defined key: {"name":"item"}
```

<a id="error-15"></a>

## Error 15: `InvalidKeyError`

Development builds show the full message. For example:

```text
getKey returned an invalid key type. Expected string or number, but got null: null. Item: {"name":"item"}
```

```text
getKey returned an invalid key type. Expected string or number, but got object: {"id":1}. Item: {"name":"item"}
```

<a id="error-16"></a>

## Error 16: `DuplicateKeyError`

Development builds show the full message. For example:

```text
Cannot insert document with ID "key-1" because it already exists in the collection
```

<a id="error-17"></a>

## Error 17: `DuplicateKeySyncError`

Development builds show the full message. For example:

```text
Cannot insert document with key "123" from sync because it already exists in the collection "collection-1"
```

```text
Cannot insert document with key "key-1" from sync because it already exists in the collection "collection-1". This collection uses a custom getKey with .distinct(). The .distinct() operator deduplicates by the ENTIRE selected object (standard SQL behavior), but your custom getKey extracts only a subset of fields. This causes multiple distinct rows (with different values in non-key fields) to receive the same key. To fix this, either: (1) ensure your SELECT only includes fields that uniquely identify each row, (2) use .groupBy() with min()/max() aggregates to select one value per group, or (3) remove the custom getKey to use the default key behavior.
```

```text
Cannot insert document with key "key-1" from sync because it already exists in the collection "collection-1". This collection uses a custom getKey with joined queries. Joined queries can produce multiple rows with the same key when relationships are not 1:1. Consider: (1) using a composite key in your getKey function (e.g., `${item.key1}-${item.key2}`), (2) ensuring your join produces unique rows per key, or (3) removing the custom getKey to use the default composite key behavior.
```

<a id="error-18"></a>

## Error 18: `MissingUpdateArgumentError`

Development builds show the full message. For example:

```text
The first argument to update is missing
```

<a id="error-19"></a>

## Error 19: `NoKeysPassedToUpdateError`

Development builds show the full message. For example:

```text
No keys were passed to update
```

<a id="error-20"></a>

## Error 20: `UpdateKeyNotFoundError`

Development builds show the full message. For example:

```text
The key "key-1" was passed to update but an object for this key was not found in the collection
```

<a id="error-21"></a>

## Error 21: `KeyUpdateNotAllowedError`

Development builds show the full message. For example:

```text
Updating the key of an item is not allowed. Original key: "old-key", Attempted new key: "new-key". Please delete the old item and create a new one if a key change is necessary.
```

<a id="error-22"></a>

## Error 22: `NoKeysPassedToDeleteError`

Development builds show the full message. For example:

```text
No keys were passed to delete
```

<a id="error-23"></a>

## Error 23: `DeleteKeyNotFoundError`

Development builds show the full message. For example:

```text
Collection.delete was called with key 'key-1' but there is no item in the collection with this key
```

<a id="error-24"></a>

## Error 24: `MissingInsertHandlerError`

Development builds show the full message. For example:

```text
Collection.insert called directly (not within an explicit transaction) but no 'onInsert' handler is configured.
```

<a id="error-25"></a>

## Error 25: `MissingUpdateHandlerError`

Development builds show the full message. For example:

```text
Collection.update called directly (not within an explicit transaction) but no 'onUpdate' handler is configured.
```

<a id="error-26"></a>

## Error 26: `MissingDeleteHandlerError`

Development builds show the full message. For example:

```text
Collection.delete called directly (not within an explicit transaction) but no 'onDelete' handler is configured.
```

<a id="error-27"></a>

## Error 27: `QueueCapacityExceededError`

Development builds show the full message. For example:

```text
Queue capacity exceeded; the mutation was not admitted
```

<a id="error-28"></a>

## Error 28: `QueueDisposedError`

Development builds show the full message. For example:

```text
Queue has been cleaned up; the mutation was not admitted
```

<a id="error-29"></a>

## Error 29: `ThrottleCallDroppedError`

Development builds show the full message. For example:

```text
Throttle call was dropped because trailing execution is disabled
```

<a id="error-30"></a>

## Error 30: `DebounceCallDroppedError`

Development builds show the full message. For example:

```text
Debounce call was dropped because trailing execution is disabled
```

<a id="error-31"></a>

## Error 31: `MissingMutationFunctionError`

Development builds show the full message. For example:

```text
mutationFn is required when creating a transaction
```

<a id="error-32"></a>

## Error 32: `OnMutateMustBeSynchronousError`

Development builds show the full message. For example:

```text
onMutate must be synchronous and cannot return a promise. Remove async/await or returned promises from onMutate.
```

<a id="error-33"></a>

## Error 33: `TransactionNotPendingMutateError`

Development builds show the full message. For example:

```text
You can no longer call .mutate() as the transaction is no longer pending
```

<a id="error-34"></a>

## Error 34: `TransactionAlreadyCompletedRollbackError`

Development builds show the full message. For example:

```text
You can no longer call .rollback() as the transaction is already completed
```

<a id="error-35"></a>

## Error 35: `TransactionNotPendingCommitError`

Development builds show the full message. For example:

```text
You can no longer call .commit() as the transaction is no longer pending
```

<a id="error-36"></a>

## Error 36: `NoPendingSyncTransactionWriteError`

Development builds show the full message. For example:

```text
No pending sync transaction to write to
```

<a id="error-37"></a>

## Error 37: `SyncTransactionAlreadyCommittedWriteError`

Development builds show the full message. For example:

```text
The pending sync transaction is already committed, you can't still write to it.
```

<a id="error-38"></a>

## Error 38: `SyncRowReusedWithoutPreviousValueError`

Development builds show the full message. For example:

```text
A sync update for key "key-1" wrote a row object that changed in place since it was last written. The change overwrote the row's previous value. Write a new object, or pass the row's previous value as `previousValue`.
```

<a id="error-39"></a>

## Error 39: `NoPendingSyncTransactionCommitError`

Development builds show the full message. For example:

```text
No pending sync transaction to commit
```

<a id="error-40"></a>

## Error 40: `SyncTransactionAlreadyCommittedError`

Development builds show the full message. For example:

```text
The pending sync transaction is already committed, you can't commit it again.
```

<a id="error-41"></a>

## Error 41: `SyncQueueInvariantError`

Development builds show the full message. For example:

```text
Sync queue invariant failed: invariant detail
```

<a id="error-42"></a>

## Error 42: `OnlyOneSourceAllowedError`

Development builds show the full message. For example:

```text
Only one source is allowed in the join clause
```

<a id="error-43"></a>

## Error 43: `SubQueryMustHaveFromClauseError`

Development builds show the full message. For example:

```text
A sub query passed to a join clause must have a from clause itself
```

<a id="error-44"></a>

## Error 44: `InvalidSourceError`

Development builds show the full message. For example:

```text
Invalid source for live query: The value provided for alias "todos" is not a Collection or subquery. Live queries only accept Collection instances or subqueries. Please ensure you're passing a valid Collection or QueryBuilder, not a plain array or other data type.
```

<a id="error-45"></a>

## Error 45: `InvalidSourceTypeError`

Development builds show the full message. For example:

```text
Invalid source for from clause: Expected an object with a single key-value pair like { alias: collection }. For example: .from({ todos: todosCollection }). Got: string
```

```text
Invalid source for join clause: Expected an object with a single key-value pair like { alias: collection }. For example: .join({ todos: todosCollection }, ({ todo, todos }) => eq(todo.id, todos.id)). Got: number
```

```text
Invalid source for unionAll clause: Expected an object with one or more key-value pairs like { alias: collection }. For example: .unionAll({ todos: todosCollection, events: eventsCollection }). Got: undefined
```

<a id="error-46"></a>

## Error 46: `JoinConditionMustBeEqualityError`

Development builds show the full message. For example:

```text
Join condition must be an equality expression or a nonempty conjunction of equality expressions
```

<a id="error-47"></a>

## Error 47: `QueryMustHaveFromClauseError`

Development builds show the full message. For example:

```text
Query must have a from clause
```

<a id="error-48"></a>

## Error 48: `InvalidWhereExpressionError`

Development builds show the full message. For example:

```text
Invalid where() expression: Expected a query expression, but received a boolean. This usually happens when using JavaScript's comparison operators (===, !==, <, >, etc.) directly. Instead, use the query builder functions:

  ❌ .where(({ user }) => user.id === 'abc')
  ✅ .where(({ user }) => eq(user.id, 'abc'))

Available comparison functions: eq, gt, gte, lt, lte, and, or, not, like, ilike, isNull, isUndefined
```

<a id="error-49"></a>

## Error 49: `UnsafeAliasPathError`

Development builds show the full message. For example:

```text
Unsafe alias path segment "__proto__" is not allowed in .select(). Aliases must not contain "__proto__", "prototype", or "constructor".
```

<a id="error-50"></a>

## Error 50: `DistinctRequiresSelectError`

Development builds show the full message. For example:

```text
DISTINCT requires a SELECT clause.
```

<a id="error-51"></a>

## Error 51: `FnSelectWithGroupByError`

Development builds show the full message. For example:

```text
fn.select() cannot be used with groupBy(). groupBy requires the compiler to statically analyze aggregate functions (count, sum, max, etc.) in the SELECT clause, which is not possible with fn.select() since it is an opaque function. Use .select() instead of .fn.select() when combining with groupBy().
```

<a id="error-52"></a>

## Error 52: `UnsupportedFnSelectResultError`

Development builds show the full message. For example:

```text
fn.select() cannot return query builder. Child query builders, query expressions, and helpers such as eq(), toArray(), materialize(), concat(toArray()), and caseWhen() are query-construction values. Use them as direct fields in .select() instead.
```

<a id="error-53"></a>

## Error 53: `UnsupportedRootScalarSelectError`

Development builds show the full message. For example:

```text
Top-level scalar select() is not supported by createLiveQueryCollection() or queryOnce(). Return an object from .select(), or use the scalar query inside toArray(...) or concat(toArray(...)).
```

<a id="error-54"></a>

## Error 54: `HavingRequiresGroupByError`

Development builds show the full message. For example:

```text
HAVING clause requires GROUP BY clause
```

<a id="error-55"></a>

## Error 55: `LimitOffsetRequireOrderByError`

Development builds show the full message. For example:

```text
LIMIT and OFFSET require an ORDER BY clause to ensure deterministic results
```

<a id="error-56"></a>

## Error 56: `CollectionInputNotFoundError`

Development builds show the full message. For example:

```text
Input for alias "alias" (collection "collection-1") not found in inputs map. Available keys: key1, key2
```

```text
Input for collection "alias" not found in inputs map
```

<a id="error-57"></a>

## Error 57: `DuplicateAliasInSubqueryError`

Development builds show the full message. For example:

```text
Subquery uses alias "alias" which is already used in the parent query. Each alias must be unique across parent and subquery contexts. Parent query aliases: parent1, parent2. Please rename "alias" in either the parent query or subquery to avoid conflicts.
```

<a id="error-58"></a>

## Error 58: `UnsupportedFromTypeError`

Development builds show the full message. For example:

```text
Unsupported FROM type: string
```

<a id="error-59"></a>

## Error 59: `UnknownExpressionTypeError`

Development builds show the full message. For example:

```text
Unknown expression type: custom
```

<a id="error-60"></a>

## Error 60: `EmptyReferencePathError`

Development builds show the full message. For example:

```text
Reference path cannot be empty
```

<a id="error-61"></a>

## Error 61: `UnknownFunctionError`

Development builds show the full message. For example:

```text
Unknown function: customFn
```

<a id="error-62"></a>

## Error 62: `JoinCollectionNotFoundError`

Development builds show the full message. For example:

```text
Collection "collection-1" not found during compilation of join
```

<a id="error-63"></a>

## Error 63: `UnsupportedJoinTypeError`

Development builds show the full message. For example:

```text
Unsupported join type: OUTER
```

<a id="error-64"></a>

## Error 64: `InvalidJoinConditionSameSourceError`

Development builds show the full message. For example:

```text
Invalid join condition: both expressions refer to the same source "todos"
```

<a id="error-65"></a>

## Error 65: `InvalidJoinConditionSourceMismatchError`

Development builds show the full message. For example:

```text
Invalid join condition: expressions must reference source aliases
```

<a id="error-66"></a>

## Error 66: `InvalidJoinConditionLeftSourceError`

Development builds show the full message. For example:

```text
Invalid join condition: left expression refers to an unavailable source "todos"
```

<a id="error-67"></a>

## Error 67: `InvalidJoinConditionRightSourceError`

Development builds show the full message. For example:

```text
Invalid join condition: right expression does not refer to the joined source "comments"
```

<a id="error-68"></a>

## Error 68: `InvalidJoinCondition`

Development builds show the full message. For example:

```text
Invalid join condition
```

<a id="error-69"></a>

## Error 69: `UnsupportedJoinSourceTypeError`

Development builds show the full message. For example:

```text
Unsupported join source type: custom
```

<a id="error-70"></a>

## Error 70: `NonAggregateExpressionNotInGroupByError`

Development builds show the full message. For example:

```text
Non-aggregate expression 'field' in SELECT must also appear in GROUP BY clause
```

<a id="error-71"></a>

## Error 71: `UnsupportedAggregateFunctionError`

Development builds show the full message. For example:

```text
Unsupported aggregate function: customAgg
```

<a id="error-72"></a>

## Error 72: `AggregateFunctionNotInSelectError`

Development builds show the full message. For example:

```text
Aggregate function in HAVING clause must also be in SELECT clause: count
```

<a id="error-73"></a>

## Error 73: `UnknownHavingExpressionTypeError`

Development builds show the full message. For example:

```text
Unknown expression type in HAVING clause: custom
```

<a id="error-74"></a>

## Error 74: `SerializationError`

Development builds show the full message. For example:

```text
Cannot write item because it cannot be JSON serialized: circular reference
```

<a id="error-75"></a>

## Error 75: `StorageKeyRequiredError`

Development builds show the full message. For example:

```text
[LocalStorageCollection] storageKey must be provided.
```

<a id="error-76"></a>

## Error 76: `InvalidStorageDataFormatError`

Development builds show the full message. For example:

```text
[LocalStorageCollection] Invalid data format in storage key "storageKey" for key "key".
```

<a id="error-77"></a>

## Error 77: `InvalidStorageObjectFormatError`

Development builds show the full message. For example:

```text
[LocalStorageCollection] Invalid data format in storage key "storageKey". Expected object format.
```

<a id="error-78"></a>

## Error 78: `SyncCleanupError`

Development builds show the full message. For example:

```text
Collection "collection-1" sync cleanup function threw an error: Cleanup failed
```

```text
Collection "collection-1" sync cleanup function threw an error: Cleanup threw
```

<a id="error-79"></a>

## Error 79: `SyncTransactionAbortedError`

Development builds show the full message. For example:

```text
Sync transaction was aborted before application
```

<a id="error-80"></a>

## Error 80: `CollectionPreloadAbortedError`

Development builds show the full message. For example:

```text
Collection preload was abandoned during cleanup
```

<a id="error-81"></a>

## Error 81: `LoadSubsetOperationAbortedError`

Development builds show the full message. For example:

```text
Load subset operation was aborted before its result became visible
```

<a id="error-82"></a>

## Error 82: `CannotCombineEmptyExpressionListError`

Development builds show the full message. For example:

```text
Cannot combine empty expression list
```

<a id="error-83"></a>

## Error 83: `MissingAliasInputsError`

Development builds show the full message. For example:

```text
Internal error: compiler returned aliases without inputs: alias1, alias2. This indicates a bug in query compilation. Please report this issue.
```

<a id="error-84"></a>

## Error 84: `SetWindowRequiresOrderByError`

Development builds show the full message. For example:

```text
setWindow() can only be called on collections with an ORDER BY clause. Add .orderBy() to your query to enable window movement.
```

<a id="error-85"></a>

## Error 85: `SetWindowReentrancyError`

Development builds show the full message. For example:

```text
setWindow() cannot run reentrantly. Wait for the current window operation to return before starting another one.
```

<a id="error-86"></a>

## Error 86: `PacedTransactionManualCommitError`

Development builds show the full message. For example:

```text
Paced mutations are committed by their strategy. Await the transaction receipt or roll it back instead.
```

<a id="error-87"></a>

## Error 87: `UnhashableQueryIRError`

Development builds show the full message. For example:

```text
Query IR is not stably hashable at query.fnSelect: function select
```

<a id="error-175"></a>

## Error 175: `DatabaseRequiredError`

Development builds show the full message. For example:

```text
IndexedDB collection requires a "db" configuration option. Create a database instance using createIndexedDB() and pass it to the collection.
```

<a id="error-176"></a>

## Error 176: `ObjectStoreNotFoundError`

Development builds show the full message. For example:

```text
Object store "todos" not found in database "app". Available stores: [users, posts]. Add "todos" to the stores array when calling createIndexedDB().
```

<a id="error-177"></a>

## Error 177: `NameRequiredError`

Development builds show the full message. For example:

```text
IndexedDB collection requires a "name" configuration option. This is the name of the object store within the database.
```

<a id="error-178"></a>

## Error 178: `GetKeyRequiredError`

Development builds show the full message. For example:

```text
IndexedDB collection requires a "getKey" configuration option. This function extracts the unique key from each item.
```

## Other errors and log messages

These are plain `Error`, `TypeError`, `RangeError`, or
`AggregateError` values, and `console` messages about runtime failures.
Each heading names the source file under `packages/db/src` that writes it.

<a id="error-88"></a>

## Error 88: `client.ts`

Development builds show this message, with `${...}` replaced by values:

```text
collectionOptions requires a non-empty explicit id so the descriptor is stable across DbClient instances and SSR boundaries.
```

<a id="error-89"></a>

## Error 89: `client.ts`

Development builds show this message, with `${...}` replaced by values:

```text
collectionOptions("${id}") requires a factory as its second argument.
```

<a id="error-90"></a>

## Error 90: `client.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Collection descriptor "${id}" was created from a concrete config that cannot be safely reused across DbClient instances. Use collectionOptions("${id}", (client) => adapterCollectionOptions(...)) or an adapter options creator that supports DbClient materialization.
```

<a id="error-91"></a>

## Error 91: `client.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Collection descriptor "${id}" materialized a config with id "${materialized.id}". Descriptor and collection ids must match.
```

<a id="error-92"></a>

## Error 92: `client.ts`

Development builds show this message, with `${...}` replaced by values:

```text
DbClient is missing the required "${key}" dependency. Pass it explicitly when constructing the client: new DbClient({ ${key} }).
```

<a id="error-93"></a>

## Error 93: `client.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Dehydrated live query "${dehydratedQuery.queryHash}" has neither a snapshot nor a promise.
```

<a id="error-94"></a>

## Error 94: `collection/change-events.ts`

Development builds show this message, with `${...}` replaced by values:

```text
limit cannot be used without orderBy
```

<a id="error-95"></a>

## Error 95: `collection/changes.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Cannot specify both 'where' and 'whereExpression' options. Use one or the other.
```

<a id="error-96"></a>

## Error 96: `collection/subscription.ts`

Development builds show this message, with `${...}` replaced by values:

```text
limit is required
```

<a id="error-97"></a>

## Error 97: `collection/subscription.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Ordered snapshot was requested but no index was found. You have to call setOrderByIndex before requesting an ordered snapshot.
```

<a id="error-98"></a>

## Error 98: `event-emitter.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Timeout waiting for event ${String(event)}
```

<a id="error-99"></a>

## Error 99: `indexes/base-index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to evaluate index expression for key ${key}: ${error}
```

<a id="error-100"></a>

## Error 100: `indexes/basic-index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Operation ${operation} not supported by BasicIndex
```

<a id="error-101"></a>

## Error 101: `indexes/btree-index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Operation ${operation} not supported by BTreeIndex
```

<a id="error-102"></a>

## Error 102: `live-query-options.ts`

Development builds show this message, with `${...}` replaced by values:

```text
A live query must be a QueryBuilder, LiveQueryCollectionConfig, Collection, undefined, or null. Got: ${typeof value}
```

<a id="error-103"></a>

## Error 103: `live-query-window-controller.ts`

Development builds show this message, with `${...}` replaced by values:

```text
useLiveInfiniteQuery: First argument must be either a pre-created live query collection or a query function. Received: ${typeof input}
```

<a id="error-104"></a>

## Error 104: `live-query-window-controller.ts`

Development builds show this message, with `${...}` replaced by values:

```text
useLiveInfiniteQuery: Query function must return a query builder. Disabled null or undefined queries are not supported.
```

<a id="error-105"></a>

## Error 105: `live-query-window-controller.ts`

Development builds show this message, with `${...}` replaced by values:

```text
useLiveInfiniteQuery: Infinite queries do not support single-result queries. Remove .findOne().
```

<a id="error-106"></a>

## Error 106: `live-query-window-controller.ts`

Development builds show this message, with `${...}` replaced by values:

```text
useLiveInfiniteQuery: Pre-created live query collection must have an ORDER BY (orderBy) clause for infinite pagination to work. Please add .orderBy() to your createLiveQueryCollection query.
```

<a id="error-107"></a>

## Error 107: `paced-mutations.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Strategy callback called but transaction is in state "${transaction.state}". Expected "pending".
```

<a id="error-108"></a>

## Error 108: `paced-mutations.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Paced transaction has no strategy-owned commit
```

<a id="error-109"></a>

## Error 109: `proxy.ts`

Development builds show this message, with `${...}` replaced by values:

```text
forEach callback must be a function
```

<a id="error-110"></a>

## Error 110: `query/builder/functions.ts`

Development builds show this message, with `${...}` replaced by values:

```text
concat(toArray(...)) currently supports only a single toArray(...) argument
```

<a id="error-111"></a>

## Error 111: `query/builder/functions.ts`

Development builds show this message, with `${...}` replaced by values:

```text
caseWhen() requires at least two arguments
```

<a id="error-112"></a>

## Error 112: `query/builder/functions.ts`

Development builds show this message, with `${...}` replaced by values:

```text
caseWhen() conditions must be expression-like values
```

<a id="error-113"></a>

## Error 113: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Cannot use collection descriptor "${alias}" as a query source without a DbClient resolver. In React, wrap your tree in <DbProvider>.
```

<a id="error-114"></a>

## Error 114: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Conditional include branch is missing a field name
```

<a id="error-115"></a>

## Error 115: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
toArray() must wrap a subquery builder
```

<a id="error-116"></a>

## Error 116: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Conditional toArray() branch is missing a field name
```

<a id="error-117"></a>

## Error 117: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
concat(toArray(...)) must wrap a subquery builder
```

<a id="error-118"></a>

## Error 118: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Conditional concat(toArray(...)) branch is missing a field name
```

<a id="error-119"></a>

## Error 119: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
toArray() must wrap a subquery builder
```

<a id="error-120"></a>

## Error 120: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
concat(toArray(...)) must wrap a subquery builder
```

<a id="error-121"></a>

## Error 121: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
materialize() must wrap a subquery builder
```

<a id="error-122"></a>

## Error 122: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
caseWhen() requires at least two arguments
```

<a id="error-123"></a>

## Error 123: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Includes subquery for "${fieldName}" must have a WHERE clause with an eq() condition that correlates a parent field with a child field. Example: .where(({child}) => eq(child.parentId, parent.id))
```

<a id="error-124"></a>

## Error 124: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
concat(toArray(...)) for "${fieldName}" requires the subquery to select a scalar value
```

<a id="error-125"></a>

## Error 125: `query/builder/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Includes subquery for "${fieldName}" must select an object when materializing as a Collection
```

<a id="error-126"></a>

## Error 126: `query/builder/ref-proxy.ts`

Development builds show this message, with `${...}` replaced by values:

```text
${name} cannot be used inside expressions (e.g., coalesce(), eq(), not()). Use ${name} directly as a select field value instead.
```

<a id="error-127"></a>

## Error 127: `query/compiler/evaluators.ts`

Development builds show this message, with `${...}` replaced by values:

```text
caseWhen() requires at least two arguments
```

<a id="error-128"></a>

## Error 128: `query/compiler/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
fn.select() cannot consume Collection-valued includes. Use toArray() or materialize() in the upstream select(), or use an expression select() to keep live Collections.
```

<a id="error-129"></a>

## Error 129: `query/compiler/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Query row has negative multiplicity
```

<a id="error-130"></a>

## Error 130: `query/compiler/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Query row has no positive contributor
```

<a id="error-131"></a>

## Error 131: `query/compiler/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Query contributors with the same row key are not congruent
```

<a id="error-132"></a>

## Error 132: `query/compiler/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Duplicate source alias "${source.alias}" in unionAll query branches. Use distinct aliases in each branch before passing them to unionAll().
```

<a id="error-133"></a>

## Error 133: `query/compiler/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Includes subqueries must be at the top level of select(). Found nested includes at "${parentPath}.${key}".
```

<a id="error-134"></a>

## Error 134: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Source collection '${collectionId}' was cleaned up while effect depends on it
```

<a id="error-135"></a>

## Error 135: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Source collection '${collectionId}' entered error state
```

<a id="error-136"></a>

## Error 136: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
No handler provided for operator: ${name}. Available handlers: ${Object.keys(handlers).join(`, `)}
```

<a id="error-137"></a>

## Error 137: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
ORDER BY expression must be a field reference, got: ${clause.expression.type}
```

<a id="error-138"></a>

## Error 138: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
extractSimpleComparisons requires a comparison or null check inside 'not' operator.
```

<a id="error-139"></a>

## Error 139: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
extractSimpleComparisons requires a field reference for '${arg.name}' operator.
```

<a id="error-140"></a>

## Error 140: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
extractSimpleComparisons requires simple field-value comparisons. Found complex expression for 'not(${arg.name})' operator.
```

<a id="error-141"></a>

## Error 141: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
extractSimpleComparisons does not support 'not(${arg.name})'. NOT can only wrap comparison operators (eq, gt, gte, lt, lte, in) or null checks (isNull, isUndefined).
```

<a id="error-142"></a>

## Error 142: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
extractSimpleComparisons does not support '${e.name}' operator. Use parseWhereExpression with custom handlers for complex expressions.
```

<a id="error-143"></a>

## Error 143: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
extractSimpleComparisons requires a field reference for '${e.name}' operator.
```

<a id="error-144"></a>

## Error 144: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
extractSimpleComparisons requires simple field-value comparisons. Found complex expression for '${e.name}' operator.
```

<a id="error-145"></a>

## Error 145: `query/expression-helpers.ts`

Development builds show this message, with `${...}` replaced by values:

```text
extractSimpleComparisons encountered unknown operator: '${e.name}'
```

<a id="error-146"></a>

## Error 146: `query/live/bucket-facade-adapter.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Bucket facade row has no public key
```

<a id="error-147"></a>

## Error 147: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Source recovery failed
```

<a id="error-148"></a>

## Error 148: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
maybeRunGraph called without active sync run. This should not happen.
```

<a id="error-149"></a>

## Error 149: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
scheduleGraphRun called without active sync run. This should not happen.
```

<a id="error-150"></a>

## Error 150: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Live query result key ${String(key)} changed by ${inserts - deletes} rows in one flush; a key has at most one result row.
```

<a id="error-151"></a>

## Error 151: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Could not apply changes: ${JSON.stringify(changes)}. This should never happen.
```

<a id="error-152"></a>

## Error 152: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Source collection '${collectionId}' was manually cleaned up while live query '${this.id}' depends on it. Live queries prevent automatic GC, so this was likely a manual cleanup() call.
```

<a id="error-153"></a>

## Error 153: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Query '${this.id}' has no collection sources. This should not happen; please report.
```

<a id="error-154"></a>

## Error 154: `query/live/materialized-pipeline.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Canonical query row has negative multiplicity
```

<a id="error-155"></a>

## Error 155: `query/live/materialized-pipeline.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Canonical query row has no positive contributor
```

<a id="error-156"></a>

## Error 156: `query/live/materialized-pipeline.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Query contributors for public key ${serializeValue(left.publicKey)} are not congruent
```

<a id="error-157"></a>

## Error 157: `query/live/materialized-pipeline.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Materialization bucket row has negative multiplicity
```

<a id="error-158"></a>

## Error 158: `query/live/materialized-pipeline.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Collection includes require a bucket facade
```

<a id="error-159"></a>

## Error 159: `query/live/subset-demand-controller.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Subset demand snapshot did not start
```

<a id="error-160"></a>

## Error 160: `query/live/utils.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to extract collection. Invalid FROM clause: ${JSON.stringify(query)}
```

<a id="error-161"></a>

## Error 161: `scheduler.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Scheduler detected unresolved dependencies for context ${String(contextId)}.
```

<a id="error-162"></a>

## Error 162: `transactions.ts`

Development builds show this message, with `${...}` replaced by values:

```text
A transaction created with createTransaction() cannot mutate collections from multiple DbClient instances. Use dbClient.createTransaction() for explicit client scope.
```

<a id="error-163"></a>

## Error 163: `transactions.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Transaction is not associated with a TransactionScope.
```

<a id="error-164"></a>

## Error 164: `transactions.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Transaction is not associated with an ambient scope.
```

<a id="error-165"></a>

## Error 165: `transactions.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Unhandled mutation combination: ${_exhaustive}
```

<a id="error-166"></a>

## Error 166: `utils/comparison.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Index comparator must return a number, but returned ${String(result)}
```

<a id="error-167"></a>

## Error 167: `utils/comparison.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Cannot order Temporal values of different types: ${aTag} vs ${bTag}
```

<a id="error-168"></a>

## Error 168: `utils/comparison.ts`

Development builds show this message, with `${...}` replaced by values:

```text
${aTag} has no defined ordering
```

<a id="error-169"></a>

## Error 169: `utils/cursor.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Only leading-column cursors are supported
```

<a id="error-170"></a>

## Error 170: `utils/error.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Unknown error
```

<a id="error-171"></a>

## Error 171: `utils/uuid.ts`

Development builds show this message, with `${...}` replaced by values:

```text
No secure random number generator available: neither crypto.randomUUID nor crypto.getRandomValues is defined in this environment.
```

<a id="error-172"></a>

## Error 172: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Source collection '${collectionId}' entered error state
```

<a id="error-173"></a>

## Error 173: `collection/lifecycle.ts`

Development builds show this message, with `${...}` replaced by values:

```text
${syncFailure ? Adapter cleanup and local teardown both failed : Multiple local teardown steps failed}
```

<a id="error-174"></a>

## Error 174: `transactions.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Mutation callback and restoration failed
```

<a id="error-179"></a>

## Error 179: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
IndexedDB is not available in this environment. Ensure you are running in a browser or provide a custom IDBFactory for testing.
```

<a id="error-182"></a>

## Error 182: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to open IndexedDB database "${name}": ${error instanceof Error ? error.message : String(error)}
```

<a id="error-183"></a>

## Error 183: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Database upgrade failed for "${name}": ${error instanceof Error ? error.message : String(error)}
```

<a id="error-184"></a>

## Error 184: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to open IndexedDB database "${name}": ${errorMessage}
```

<a id="error-185"></a>

## Error 185: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Cannot create object store "${storeName}": This operation is only allowed during a database upgrade. Ensure you are calling createObjectStore within the onUpgrade callback of openDatabase.
```

<a id="error-186"></a>

## Error 186: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Object store "${storeName}" already exists in the database. Check the database version and only create stores when needed.
```

<a id="error-187"></a>

## Error 187: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to create object store "${storeName}": ${error instanceof Error ? error.message : String(error)}
```

<a id="error-188"></a>

## Error 188: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to create transaction for stores [${storeNamesArray.join(', ')}]: ${error instanceof Error ? error.message : String(error)}
```

<a id="error-189"></a>

## Error 189: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Object store "${storeName}" not found in the database. Ensure the store was created during the database upgrade.
```

<a id="error-190"></a>

## Error 190: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Transaction was aborted
```

<a id="error-191"></a>

## Error 191: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to delete IndexedDB database "${name}": ${error instanceof Error ? error.message : String(error)}
```

<a id="error-192"></a>

## Error 192: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to delete IndexedDB database "${name}": ${errorMessage}
```

<a id="error-193"></a>

## Error 193: `indexed-db.ts`

Development builds show this message, with `${...}` replaced by values:

```text
createIndexedDB requires at least one store in the stores array.
```

<a id="error-194"></a>

## Error 194: `indexed-db.ts`

Development builds show this message, with `${...}` replaced by values:

```text
createIndexedDB stores array contains duplicate store names.
```

<a id="error-195"></a>

## Error 195: `indexed-db.ts`

Development builds show this message, with `${...}` replaced by values:

```text
The "_versions" store is reserved for IndexedDB Collection metadata.
```

<a id="error-196"></a>

## Error 196: `indexed-db.ts`

Development builds show this message, with `${...}` replaced by values:

```text
createIndexedDB stores array contains invalid store names. Each store name must be a non-empty string.
```

<a id="error-197"></a>

## Error 197: `indexed-db.ts`

Development builds show this message, with `${...}` replaced by values:

```text
IndexedDB connection "${name}" closed. Recreate its Collections with a new database instance.
```

<a id="error-198"></a>

## Error 198: `indexed-db.ts`

Development builds show this message, with `${...}` replaced by values:

```text
The "_versions" store is reserved for IndexedDB Collection metadata.
```

<a id="error-199"></a>

## Error 199: `indexed-db.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Duplicate imported key: ${key}
```

<a id="error-200"></a>

## Error 200: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to get all keys from object store "${objectStore.name}": ${cause}
```

<a id="error-201"></a>

## Error 201: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to write item to object store "${objectStore.name}": ${cause}
```

<a id="error-202"></a>

## Error 202: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to delete item with key "${String(key)}" from object store "${objectStore.name}": ${cause}
```

<a id="error-203"></a>

## Error 203: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to clear object store "${objectStore.name}": ${cause}
```

<a id="error-204"></a>

## Error 204: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to get all items from object store "${objectStore.name}": ${cause}
```

<a id="error-205"></a>

## Error 205: `indexed-db-wrapper.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to get item with key "${String(key)}" from object store "${objectStore.name}": ${cause}
```

<a id="error-206"></a>

## Error 206: `collection/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
autoIndex: 'eager' requires defaultIndexType to be set. Import an index type and set it:
  import { BasicIndex } from '@tanstack/db'
  createCollection({ defaultIndexType: BasicIndex, autoIndex: 'eager', ... })
```

<a id="error-207"></a>

## Error 207: `collection/indexes.ts`

Development builds show this message, with `${...}` replaced by values:

```text
No index type specified and no defaultIndexType set on collection. Either pass indexType in config, or set defaultIndexType on the collection:
  import { BasicIndex } from '@tanstack/db'
  createCollection({ defaultIndexType: BasicIndex, ... })
```

<a id="error-208"></a>

## Error 208: `collection/lifecycle.ts`

Development builds show this message, with `${...}` replaced by values:

```text
You can't directly call "setStatus('ready'). You must use markReady instead.
```

<a id="error-209"></a>

## Error 209: `collection/lifecycle.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Cannot start collection "${this.id}" during cleanup. Restart after cleanup() completes.
```

<a id="error-210"></a>

## Error 210: `collection/sync.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Collection "${this.id}" is configured with syncMode "on-demand" but the sync function did not return a loadSubset handler. Either provide a loadSubset handler or use syncMode "eager".
```

<a id="error-211"></a>

## Error 211: `query/compiler/index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Query uses alias "${alias}" more than once. Give each source in one query a distinct alias.
```

<a id="error-212"></a>

## Error 212: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Live query graph failed
```

<a id="warning-213"></a>

## Warning 213: `collection/change-events.ts`

Development builds show this message, with `${...}` replaced by values:

```text
${collection.id ? `[${collection.id}] ` : ``}Error processing where clause, falling back to full scan:
```

<a id="error-214"></a>

## Error 214: `collection/cleanup-queue.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Error in CleanupQueue task:
```

<a id="warning-215"></a>

## Warning 215: `indexes/auto-index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
${collection.id ? `[${collection.id}] ` : ``}Failed to create auto-index for field path "${fieldPath.join(`.`)}":
```

<a id="warning-216"></a>

## Warning 216: `indexes/base-index.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Failed to evaluate index expression for key ${key} during removal:
```

<a id="error-218"></a>

## Error 218: `local-storage.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[LocalStorageCollection] Error saving data to storage key "${config.storageKey}":
```

<a id="warning-219"></a>

## Warning 219: `local-storage.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[LocalStorageCollection] Error loading data from storage key "${storageKey}":
```

<a id="error-220"></a>

## Error 220: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[Effect '${id}'] onSourceError callback threw:
```

<a id="error-221"></a>

## Error 221: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[Effect '${id}'] ${error.message}. Disposing effect.
```

<a id="error-222"></a>

## Error 222: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[Effect '${id}'] failed to dispose after a source error:
```

<a id="error-223"></a>

## Error 223: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[Effect '${id}'] failed to dispose after a startup error:
```

<a id="error-224"></a>

## Error 224: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[Effect] Error in onError handler:
```

<a id="error-225"></a>

## Error 225: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[Effect] Original error:
```

<a id="error-226"></a>

## Error 226: `query/effect.ts`

Development builds show this message, with `${...}` replaced by values:

```text
[Effect] Unhandled error in handler:
```

<a id="error-228"></a>

## Error 228: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Subset demand '${planId}' failed: ${normalized.message}
```

<a id="error-229"></a>

## Error 229: `query/live/collection-config-builder.ts`

Development builds show this message, with `${...}` replaced by values:

```text
Initial subset load failed: ${normalized.message}
```
