Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

CollectionInputNotFoundError.md

234 lines4.8 KB

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