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