Open History to see the last commit
1---
2id: CollectionConfigurationError
3title: CollectionConfigurationError
4---
5
6Defined in: [packages/db/src/errors.ts:71](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L71)
7
8## Extends
9
10- [`TanStackDBError`](TanStackDBError.md)
11
12## Extended by
13
14- [`CollectionRequiresConfigError`](CollectionRequiresConfigError.md)
15- [`CollectionRequiresSyncConfigError`](CollectionRequiresSyncConfigError.md)
16- [`InvalidSchemaError`](InvalidSchemaError.md)
17- [`SchemaMustBeSynchronousError`](SchemaMustBeSynchronousError.md)
18
19## Constructors
20
21### Constructor
22
23```ts
24new CollectionConfigurationError(message): CollectionConfigurationError;
25```
26
27Defined in: [packages/db/src/errors.ts:72](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L72)
28
29#### Parameters
30
31##### message
32
33`string`
34
35#### Returns
36
37`CollectionConfigurationError`
38
39#### Overrides
40
41[`TanStackDBError`](TanStackDBError.md).[`constructor`](TanStackDBError.md#constructor)
42
43## Properties
44
45### cause?
46
47```ts
48optional cause: unknown;
49```
50
51Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:26
52
53#### Inherited from
54
55[`TanStackDBError`](TanStackDBError.md).[`cause`](TanStackDBError.md#cause)
56
57***
58
59### message
60
61```ts
62message: string;
63```
64
65Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
66
67#### Inherited from
68
69[`TanStackDBError`](TanStackDBError.md).[`message`](TanStackDBError.md#message)
70
71***
72
73### name
74
75```ts
76name: string;
77```
78
79Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1076
80
81#### Inherited from
82
83[`TanStackDBError`](TanStackDBError.md).[`name`](TanStackDBError.md#name)
84
85***
86
87### stack?
88
89```ts
90optional stack: string;
91```
92
93Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
94
95#### Inherited from
96
97[`TanStackDBError`](TanStackDBError.md).[`stack`](TanStackDBError.md#stack)
98
99***
100
101### stackTraceLimit
102
103```ts
104static stackTraceLimit: number;
105```
106
107Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:67
108
109The `Error.stackTraceLimit` property specifies the number of stack frames
110collected by a stack trace (whether generated by `new Error().stack` or
111`Error.captureStackTrace(obj)`).
112
113The default value is `10` but may be set to any valid JavaScript number. Changes
114will affect any stack trace captured _after_ the value has been changed.
115
116If set to a non-number value, or set to a negative number, stack traces will
117not capture any frames.
118
119#### Inherited from
120
121[`TanStackDBError`](TanStackDBError.md).[`stackTraceLimit`](TanStackDBError.md#stacktracelimit)
122
123## Methods
124
125### captureStackTrace()
126
127```ts
128static captureStackTrace(targetObject, constructorOpt?): void;
129```
130
131Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:51
132
133Creates a `.stack` property on `targetObject`, which when accessed returns
134a string representing the location in the code at which
135`Error.captureStackTrace()` was called.
136
137```js
138const myObject = {};
139Error.captureStackTrace(myObject);
140myObject.stack; // Similar to `new Error().stack`
141```
142
143The first line of the trace will be prefixed with
144`${myObject.name}: ${myObject.message}`.
145
146The optional `constructorOpt` argument accepts a function. If given, all frames
147above `constructorOpt`, including `constructorOpt`, will be omitted from the
148generated stack trace.
149
150The `constructorOpt` argument is useful for hiding implementation
151details of error generation from the user. For instance:
152
153```js
154function a() {
155 b();
156}
157
158function b() {
159 c();
160}
161
162function c() {
163 // Create an error without stack trace to avoid calculating the stack trace twice.
164 const { stackTraceLimit } = Error;
165 Error.stackTraceLimit = 0;
166 const error = new Error();
167 Error.stackTraceLimit = stackTraceLimit;
168
169 // Capture the stack trace above function b
170 Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
171 throw error;
172}
173
174a();
175```
176
177#### Parameters
178
179##### targetObject
180
181`object`
182
183##### constructorOpt?
184
185`Function`
186
187#### Returns
188
189`void`
190
191#### Inherited from
192
193[`TanStackDBError`](TanStackDBError.md).[`captureStackTrace`](TanStackDBError.md#capturestacktrace)
194
195***
196
197### prepareStackTrace()
198
199```ts
200static prepareStackTrace(err, stackTraces): any;
201```
202
203Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:55
204
205#### Parameters
206
207##### err
208
209`Error`
210
211##### stackTraces
212
213`CallSite`[]
214
215#### Returns
216
217`any`
218
219#### See
220
221https://v8.dev/docs/stack-trace-api#customizing-stack-traces
222
223#### Inherited from
224
225[`TanStackDBError`](TanStackDBError.md).[`prepareStackTrace`](TanStackDBError.md#preparestacktrace)