svelte-effect-runtime 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dist/chunks/{client-Cruhk6Oo.js → client-DRjQiULJ.js} +10 -9
- package/.dist/chunks/client-DRjQiULJ.js.map +1 -0
- package/.dist/chunks/{dispatcher-FCsx1Hlh.js → dispatcher-CLSN-Cxn.js} +3 -3
- package/.dist/chunks/{dispatcher-FCsx1Hlh.js.map → dispatcher-CLSN-Cxn.js.map} +1 -1
- package/.dist/chunks/{dispatcher-CgCdn6bj.js → dispatcher-CZvLODNK.js} +4 -3
- package/.dist/chunks/dispatcher-CZvLODNK.js.map +1 -0
- package/.dist/chunks/errors-DppSJ83S.js +692 -0
- package/.dist/chunks/errors-DppSJ83S.js.map +1 -0
- package/.dist/chunks/{runtime-Sl685BVb.js → runtime-BgCRz_rL.js} +4 -3
- package/.dist/chunks/runtime-BgCRz_rL.js.map +1 -0
- package/.dist/chunks/{transform-CebZMD6u.js → transform-B7_CCcvq.js} +16 -219
- package/.dist/chunks/transform-B7_CCcvq.js.map +1 -0
- package/.dist/dispatcher.js +1 -1
- package/.dist/errors.d.ts +544 -0
- package/.dist/internal/generators.js +1 -1
- package/.dist/internal/remote-client.js +1 -1
- package/.dist/markup/promise.d.ts +17 -3
- package/.dist/markup/promise.js +15 -4
- package/.dist/markup/promise.js.map +1 -1
- package/.dist/markup/run.js +1 -1
- package/.dist/markup/transform.js +1 -1
- package/.dist/markup/value.d.ts +3 -3
- package/.dist/markup/value.js +8 -4
- package/.dist/markup/value.js.map +1 -1
- package/.dist/mod.d.ts +1 -0
- package/.dist/mod.js +4 -3
- package/.dist/mod.js.map +1 -1
- package/.dist/remote/client.js +1 -1
- package/.dist/remote/server.js +3 -2
- package/.dist/remote/server.js.map +1 -1
- package/.dist/runtime/transform.js +2 -1
- package/.dist/runtime/transform.js.map +1 -1
- package/.dist/server.js +12 -11
- package/.dist/server.js.map +1 -1
- package/package.json +1 -1
- package/.dist/chunks/client-Cruhk6Oo.js.map +0 -1
- package/.dist/chunks/dispatcher-CgCdn6bj.js.map +0 -1
- package/.dist/chunks/runtime-Sl685BVb.js.map +0 -1
- package/.dist/chunks/transform-CebZMD6u.js.map +0 -1
- package/.dist/error.d.ts +0 -140
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
//#region src/errors.ts
|
|
2
|
+
/**
|
|
3
|
+
* Base class for runtime-authored errors. The class gives every local failure
|
|
4
|
+
* a stable JavaScript error name while preserving the technical message that
|
|
5
|
+
* reaches Vite, SvelteKit, and test output.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* throw new RuntimeError("Invariant violated.");
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* @since 2.4.0
|
|
13
|
+
* @param message - Technical diagnostic message describing the failed runtime
|
|
14
|
+
* invariant.
|
|
15
|
+
* @returns A runtime-authored Error instance.
|
|
16
|
+
*/
|
|
17
|
+
var RuntimeError = class extends Error {
|
|
18
|
+
constructor(message) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.name = "RuntimeError";
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Formats a runtime-owned error message with a stable screaming-case code.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* throw new Error(make_error_message("DISPATCHER_DISPOSED", "Dispatcher has been disposed"));
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @since 2.0.0
|
|
32
|
+
* @param code - Stable screaming-case identifier for the error category.
|
|
33
|
+
* @param message - Human-readable error message without the leading code.
|
|
34
|
+
* @returns The complete error message prefixed with the stable code.
|
|
35
|
+
*/
|
|
36
|
+
function make_error_message(code, message) {
|
|
37
|
+
return `[${code}]: ${message}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Base error class for all preprocessor errors emitted during script and
|
|
41
|
+
* markup transformation. Carries the source filename so error messages can
|
|
42
|
+
* reference the affected file.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* throw new PreprocessError("Component.svelte: invalid transform input.", "Component.svelte");
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @since 2.0.0
|
|
50
|
+
* @param message - Technical diagnostic message for the transform failure.
|
|
51
|
+
* @param filename - Source filename that triggered the transform failure.
|
|
52
|
+
* @returns A preprocessor Error instance with source file context.
|
|
53
|
+
*/
|
|
54
|
+
var PreprocessError = class extends RuntimeError {
|
|
55
|
+
/**
|
|
56
|
+
* The source filename that triggered this error.
|
|
57
|
+
*
|
|
58
|
+
* @since 2.0.0
|
|
59
|
+
*/
|
|
60
|
+
filename;
|
|
61
|
+
constructor(message, filename) {
|
|
62
|
+
super(message);
|
|
63
|
+
this.name = "PreprocessError";
|
|
64
|
+
this.filename = filename;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Thrown when a statement mixes JavaScript `await` with Effect `yield*` work
|
|
69
|
+
* that must be lowered into an `Effect.gen` program.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* throw new AwaitInEffectWorkError("Component.svelte", "const value = await load();");
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @since 2.0.0
|
|
77
|
+
* @param filename - Source filename containing the unsupported statement.
|
|
78
|
+
* @param statement_text - Full source text for the statement containing
|
|
79
|
+
* mixed async work.
|
|
80
|
+
* @returns A preprocessor Error instance with statement context.
|
|
81
|
+
*/
|
|
82
|
+
var AwaitInEffectWorkError = class extends PreprocessError {
|
|
83
|
+
/**
|
|
84
|
+
* The full text of the problematic statement containing mixed async work.
|
|
85
|
+
*
|
|
86
|
+
* @since 2.0.0
|
|
87
|
+
*/
|
|
88
|
+
statement_text;
|
|
89
|
+
constructor(filename, statement_text) {
|
|
90
|
+
super([
|
|
91
|
+
make_error_message("AWAIT_IN_EFFECT_WORK", `${filename}: await cannot be mixed with yield* in Effect work.`),
|
|
92
|
+
`Top-level await is supported as ordinary Svelte async rendering, but statements lowered into Effect.gen must use yield* for async Effect work.`,
|
|
93
|
+
"",
|
|
94
|
+
`Problematic statement:`,
|
|
95
|
+
statement_text
|
|
96
|
+
].join("\n"), filename);
|
|
97
|
+
this.name = "AwaitInEffectWorkError";
|
|
98
|
+
this.statement_text = statement_text;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Thrown when async Effect work appears inside a Svelte rune position that
|
|
103
|
+
* must stay synchronous.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* throw new AsyncEffectInSyncRuneError("$derived", "$derived(yield* load())", "Component.svelte");
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @since 2.0.0
|
|
111
|
+
* @param rune_name - Name of the Svelte rune containing the unsupported async
|
|
112
|
+
* Effect work.
|
|
113
|
+
* @param expression_text - Full source text for the rune expression.
|
|
114
|
+
* @param filename - Source filename containing the unsupported rune.
|
|
115
|
+
* @returns A preprocessor Error instance with rune source context.
|
|
116
|
+
*/
|
|
117
|
+
var AsyncEffectInSyncRuneError = class extends PreprocessError {
|
|
118
|
+
/**
|
|
119
|
+
* The name of the rune that contained async Effect work.
|
|
120
|
+
*
|
|
121
|
+
* @since 2.0.0
|
|
122
|
+
*/
|
|
123
|
+
rune_name;
|
|
124
|
+
/**
|
|
125
|
+
* The full text of the expression that triggered the error.
|
|
126
|
+
*
|
|
127
|
+
* @since 2.0.0
|
|
128
|
+
*/
|
|
129
|
+
expression_text;
|
|
130
|
+
constructor(rune_name, expression_text, filename) {
|
|
131
|
+
super([
|
|
132
|
+
make_error_message("ASYNC_EFFECT_IN_SYNC_RUNE", `${filename}: yield* cannot be used inside ${rune_name}().`),
|
|
133
|
+
`${rune_name}() must stay synchronous. Do not put async Effect work inside this rune.`,
|
|
134
|
+
"",
|
|
135
|
+
`Problematic expression:`,
|
|
136
|
+
expression_text
|
|
137
|
+
].join("\n"), filename);
|
|
138
|
+
this.name = "AsyncEffectInSyncRuneError";
|
|
139
|
+
this.rune_name = rune_name;
|
|
140
|
+
this.expression_text = expression_text;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Thrown when async Effect work appears inside a non-generator callback nested
|
|
145
|
+
* in a markup event handler.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* throw new AsyncEffectInEventCallbackError(
|
|
150
|
+
* "Component.svelte",
|
|
151
|
+
* "Effect.try(() => yield* save())",
|
|
152
|
+
* );
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* @since 2.0.0
|
|
156
|
+
* @param filename - Source filename containing the invalid event handler.
|
|
157
|
+
* @param expression_text - Event handler expression that contains the nested
|
|
158
|
+
* unsupported async Effect work.
|
|
159
|
+
* @returns A preprocessor Error instance with event expression context.
|
|
160
|
+
*/
|
|
161
|
+
var AsyncEffectInEventCallbackError = class extends PreprocessError {
|
|
162
|
+
/**
|
|
163
|
+
* The full text of the problematic event handler body.
|
|
164
|
+
*
|
|
165
|
+
* @since 2.0.0
|
|
166
|
+
*/
|
|
167
|
+
expression_text;
|
|
168
|
+
constructor(filename, expression_text) {
|
|
169
|
+
super([
|
|
170
|
+
make_error_message("ASYNC_EFFECT_IN_EVENT_CALLBACK", `${filename}: yield* cannot be used inside a nested non-generator callback in a markup event handler.`),
|
|
171
|
+
`Move the yield* to the event handler body. Effect.try and Effect.sync callbacks are plain synchronous JavaScript; do not call Effect-returning functions inside them.`,
|
|
172
|
+
"",
|
|
173
|
+
`Run the remote Effect directly:`,
|
|
174
|
+
` onclick={yield* UpvotePost(id)}`,
|
|
175
|
+
"",
|
|
176
|
+
`Recover from remote failures by composing the Effect value:`,
|
|
177
|
+
` onclick={yield* UpvotePost(id).pipe(Effect.catch(() => Effect.void))}`,
|
|
178
|
+
"",
|
|
179
|
+
`Problematic expression:`,
|
|
180
|
+
expression_text
|
|
181
|
+
].join("\n"), filename);
|
|
182
|
+
this.name = "AsyncEffectInEventCallbackError";
|
|
183
|
+
this.expression_text = expression_text;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Thrown when an event handler callback contains the old raw `yield*`
|
|
188
|
+
* shorthand. Effectful event handlers must put `yield*` directly in the event
|
|
189
|
+
* attribute so the callback boundary is generated by the markup runtime.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```ts
|
|
193
|
+
* throw new YieldStarInEventCallbackError("Component.svelte", "() => yield* save()");
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @since 2.0.0
|
|
197
|
+
* @param filename - Svelte component filename used to identify where the
|
|
198
|
+
* invalid event handler callback was found.
|
|
199
|
+
* @param expression_text - Original event handler callback text that contained
|
|
200
|
+
* `yield*` and should be rewritten as a direct event Effect expression.
|
|
201
|
+
* @returns A preprocessor Error instance with event callback context.
|
|
202
|
+
*/
|
|
203
|
+
var YieldStarInEventCallbackError = class extends PreprocessError {
|
|
204
|
+
/**
|
|
205
|
+
* The full text of the problematic event handler callback.
|
|
206
|
+
*
|
|
207
|
+
* @since 2.0.0
|
|
208
|
+
*/
|
|
209
|
+
expression_text;
|
|
210
|
+
constructor(filename, expression_text) {
|
|
211
|
+
super([
|
|
212
|
+
make_error_message("ASYNC_EFFECT_IN_EVENT_HANDLER_CALLBACK", `${filename}: yield* in markup event handlers must be written directly as the event attribute value.`),
|
|
213
|
+
`SER generates the event callback for effectful event handlers; do not put yield* inside a JavaScript callback.`,
|
|
214
|
+
"",
|
|
215
|
+
`Use this form:`,
|
|
216
|
+
` onclick={yield* UpvotePost(id)}`,
|
|
217
|
+
"",
|
|
218
|
+
`Instead of this form:`,
|
|
219
|
+
` onclick={() => yield* UpvotePost(id)}`,
|
|
220
|
+
"",
|
|
221
|
+
`Problematic expression:`,
|
|
222
|
+
expression_text
|
|
223
|
+
].join("\n"), filename);
|
|
224
|
+
this.name = "YieldStarInEventCallbackError";
|
|
225
|
+
this.expression_text = expression_text;
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* Thrown when async Effect work appears in a markup position SER cannot lower
|
|
230
|
+
* safely.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```ts
|
|
234
|
+
* throw new UnsupportedMarkupEffectPositionError(
|
|
235
|
+
* "Component.svelte",
|
|
236
|
+
* "value={yield* load()}",
|
|
237
|
+
* );
|
|
238
|
+
* ```
|
|
239
|
+
*
|
|
240
|
+
* @since 2.4.2
|
|
241
|
+
* @param filename - Source filename containing the unsupported markup.
|
|
242
|
+
* @param expression_text - The unsupported markup expression text.
|
|
243
|
+
* @returns A preprocessor Error instance with markup source context.
|
|
244
|
+
*/
|
|
245
|
+
var UnsupportedMarkupEffectPositionError = class extends PreprocessError {
|
|
246
|
+
/**
|
|
247
|
+
* The unsupported markup expression text.
|
|
248
|
+
*
|
|
249
|
+
* @since 2.4.2
|
|
250
|
+
*/
|
|
251
|
+
expression_text;
|
|
252
|
+
constructor(filename, expression_text) {
|
|
253
|
+
super([
|
|
254
|
+
make_error_message("UNSUPPORTED_MARKUP_EFFECT_POSITION", `${filename}: yield* cannot be used in this markup position.`),
|
|
255
|
+
`Move the Effect work into a supported expression tag, block expression, render expression, declaration tag, or event handler.`,
|
|
256
|
+
"",
|
|
257
|
+
`Problematic expression:`,
|
|
258
|
+
expression_text
|
|
259
|
+
].join("\n"), filename);
|
|
260
|
+
this.name = "UnsupportedMarkupEffectPositionError";
|
|
261
|
+
this.expression_text = expression_text;
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Thrown when the request-scoped SvelteKit event context is read outside a
|
|
266
|
+
* remote handler.
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* ```ts
|
|
270
|
+
* throw new RequestEventUnavailableError();
|
|
271
|
+
* ```
|
|
272
|
+
*
|
|
273
|
+
* @since 2.4.0
|
|
274
|
+
* @returns An Error describing missing request context.
|
|
275
|
+
*/
|
|
276
|
+
var RequestEventUnavailableError = class extends RuntimeError {
|
|
277
|
+
constructor() {
|
|
278
|
+
super("RequestEvent is only available while a SER remote handler is executing inside a request-scoped Effect context.");
|
|
279
|
+
this.name = "RequestEventUnavailableError";
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Thrown when an unchecked Query declaration omits the handler.
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* throw new UncheckedQueryHandlerMissingError();
|
|
288
|
+
* ```
|
|
289
|
+
*
|
|
290
|
+
* @since 2.4.0
|
|
291
|
+
* @returns An Error describing the invalid Query overload usage.
|
|
292
|
+
*/
|
|
293
|
+
var UncheckedQueryHandlerMissingError = class extends RuntimeError {
|
|
294
|
+
constructor() {
|
|
295
|
+
super("Query('unchecked', handler) requires a concrete handler function as the second argument; the unchecked schema sentinel cannot execute by itself.");
|
|
296
|
+
this.name = "UncheckedQueryHandlerMissingError";
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Thrown when a batch Query declaration omits the batch handler.
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* ```ts
|
|
304
|
+
* throw new BatchQueryHandlerMissingError();
|
|
305
|
+
* ```
|
|
306
|
+
*
|
|
307
|
+
* @since 2.4.0
|
|
308
|
+
* @returns An Error describing the invalid batch Query overload usage.
|
|
309
|
+
*/
|
|
310
|
+
var BatchQueryHandlerMissingError = class extends RuntimeError {
|
|
311
|
+
constructor() {
|
|
312
|
+
super("Query.batch requires a concrete batch handler function; the batch helper cannot infer a handler from schema metadata alone.");
|
|
313
|
+
this.name = "BatchQueryHandlerMissingError";
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Thrown when an unchecked live Query declaration omits the handler.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```ts
|
|
321
|
+
* throw new UncheckedLiveQueryHandlerMissingError();
|
|
322
|
+
* ```
|
|
323
|
+
*
|
|
324
|
+
* @since 2.4.0
|
|
325
|
+
* @returns An Error describing the invalid live Query overload usage.
|
|
326
|
+
*/
|
|
327
|
+
var UncheckedLiveQueryHandlerMissingError = class extends RuntimeError {
|
|
328
|
+
constructor() {
|
|
329
|
+
super("Query.live('unchecked', handler) requires a concrete handler function as the second argument; the unchecked schema sentinel cannot produce a live source.");
|
|
330
|
+
this.name = "UncheckedLiveQueryHandlerMissingError";
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* Thrown when an unchecked Command declaration omits the handler.
|
|
335
|
+
*
|
|
336
|
+
* @example
|
|
337
|
+
* ```ts
|
|
338
|
+
* throw new UncheckedCommandHandlerMissingError();
|
|
339
|
+
* ```
|
|
340
|
+
*
|
|
341
|
+
* @since 2.4.0
|
|
342
|
+
* @returns An Error describing the invalid Command overload usage.
|
|
343
|
+
*/
|
|
344
|
+
var UncheckedCommandHandlerMissingError = class extends RuntimeError {
|
|
345
|
+
constructor() {
|
|
346
|
+
super("Command('unchecked', handler) requires a concrete handler function as the second argument; the unchecked schema sentinel cannot execute a command.");
|
|
347
|
+
this.name = "UncheckedCommandHandlerMissingError";
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Thrown when an unchecked Form declaration omits the handler.
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```ts
|
|
355
|
+
* throw new UncheckedFormHandlerMissingError();
|
|
356
|
+
* ```
|
|
357
|
+
*
|
|
358
|
+
* @since 2.4.0
|
|
359
|
+
* @returns An Error describing the invalid Form overload usage.
|
|
360
|
+
*/
|
|
361
|
+
var UncheckedFormHandlerMissingError = class extends RuntimeError {
|
|
362
|
+
constructor() {
|
|
363
|
+
super("Form('unchecked', handler) requires a concrete handler function as the second argument; the unchecked schema sentinel cannot process form data.");
|
|
364
|
+
this.name = "UncheckedFormHandlerMissingError";
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* Thrown when an unchecked Prerender declaration omits the handler.
|
|
369
|
+
*
|
|
370
|
+
* @example
|
|
371
|
+
* ```ts
|
|
372
|
+
* throw new UncheckedPrerenderHandlerMissingError();
|
|
373
|
+
* ```
|
|
374
|
+
*
|
|
375
|
+
* @since 2.4.0
|
|
376
|
+
* @returns An Error describing the invalid Prerender overload usage.
|
|
377
|
+
*/
|
|
378
|
+
var UncheckedPrerenderHandlerMissingError = class extends RuntimeError {
|
|
379
|
+
constructor() {
|
|
380
|
+
super("Prerender('unchecked', handler) requires a concrete handler function as the second argument; the unchecked schema sentinel cannot produce prerendered data.");
|
|
381
|
+
this.name = "UncheckedPrerenderHandlerMissingError";
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* Thrown when a live query handler resolves to a value that cannot be streamed.
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
* ```ts
|
|
389
|
+
* throw new InvalidLiveQueryReturnError();
|
|
390
|
+
* ```
|
|
391
|
+
*
|
|
392
|
+
* @since 2.4.0
|
|
393
|
+
* @returns An Error describing the expected live query return protocol.
|
|
394
|
+
*/
|
|
395
|
+
var InvalidLiveQueryReturnError = class extends RuntimeError {
|
|
396
|
+
constructor() {
|
|
397
|
+
super("Query.live handler must return an Effect Stream, Iterable, or AsyncIterable; resolved values must expose a streaming protocol that SER can bridge to SvelteKit.");
|
|
398
|
+
this.name = "InvalidLiveQueryReturnError";
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* Thrown when a dispatcher operation is requested after disposal.
|
|
403
|
+
*
|
|
404
|
+
* @example
|
|
405
|
+
* ```ts
|
|
406
|
+
* throw new DispatcherDisposedError();
|
|
407
|
+
* ```
|
|
408
|
+
*
|
|
409
|
+
* @since 2.4.0
|
|
410
|
+
* @returns An Error describing an invalid dispatcher lifecycle transition.
|
|
411
|
+
*/
|
|
412
|
+
var DispatcherDisposedError = class extends RuntimeError {
|
|
413
|
+
constructor() {
|
|
414
|
+
super("Dispatcher has been disposed; no new Effect fibers or promise bridges can be started after component teardown.");
|
|
415
|
+
this.name = "DispatcherDisposedError";
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* Thrown when a generated or native remote query export is not callable.
|
|
420
|
+
*
|
|
421
|
+
* @example
|
|
422
|
+
* ```ts
|
|
423
|
+
* throw new InvalidQueryFactoryError();
|
|
424
|
+
* ```
|
|
425
|
+
*
|
|
426
|
+
* @since 2.4.0
|
|
427
|
+
* @returns An Error describing an invalid query adapter input.
|
|
428
|
+
*/
|
|
429
|
+
var InvalidQueryFactoryError = class extends RuntimeError {
|
|
430
|
+
constructor() {
|
|
431
|
+
super("Invalid query factory: expected a function or an object exposing query/load methods from SvelteKit remote query generation.");
|
|
432
|
+
this.name = "InvalidQueryFactoryError";
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
/**
|
|
436
|
+
* Thrown when a generated or native remote live query export is not callable.
|
|
437
|
+
*
|
|
438
|
+
* @example
|
|
439
|
+
* ```ts
|
|
440
|
+
* throw new InvalidLiveQueryFactoryError();
|
|
441
|
+
* ```
|
|
442
|
+
*
|
|
443
|
+
* @since 2.4.0
|
|
444
|
+
* @returns An Error describing an invalid live query adapter input.
|
|
445
|
+
*/
|
|
446
|
+
var InvalidLiveQueryFactoryError = class extends RuntimeError {
|
|
447
|
+
constructor() {
|
|
448
|
+
super("Invalid live query factory: expected a function or an object exposing a query method from SvelteKit remote live query generation.");
|
|
449
|
+
this.name = "InvalidLiveQueryFactoryError";
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* Thrown when a generated or native remote command export is not callable.
|
|
454
|
+
*
|
|
455
|
+
* @example
|
|
456
|
+
* ```ts
|
|
457
|
+
* throw new InvalidCommandFactoryError();
|
|
458
|
+
* ```
|
|
459
|
+
*
|
|
460
|
+
* @since 2.4.0
|
|
461
|
+
* @returns An Error describing an invalid command adapter input.
|
|
462
|
+
*/
|
|
463
|
+
var InvalidCommandFactoryError = class extends RuntimeError {
|
|
464
|
+
constructor() {
|
|
465
|
+
super("Invalid command factory: expected a function or an object exposing an invoke method from SvelteKit remote command generation.");
|
|
466
|
+
this.name = "InvalidCommandFactoryError";
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
/**
|
|
470
|
+
* Thrown when the client-side form adapter cannot derive a remote endpoint.
|
|
471
|
+
*
|
|
472
|
+
* @example
|
|
473
|
+
* ```ts
|
|
474
|
+
* throw new RemoteFormEndpointMissingError();
|
|
475
|
+
* ```
|
|
476
|
+
*
|
|
477
|
+
* @since 2.4.0
|
|
478
|
+
* @returns An Error describing missing form transport metadata.
|
|
479
|
+
*/
|
|
480
|
+
var RemoteFormEndpointMissingError = class extends RuntimeError {
|
|
481
|
+
constructor() {
|
|
482
|
+
super("Form has no submit method or remote endpoint; the adapted SvelteKit form object does not expose an action id and no remote base URL was generated.");
|
|
483
|
+
this.name = "RemoteFormEndpointMissingError";
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* Thrown when a remote form response envelope is not an object with a response
|
|
488
|
+
* type.
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
* ```ts
|
|
492
|
+
* throw new InvalidRemoteFormResponseError(envelope);
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
495
|
+
* @since 2.4.0
|
|
496
|
+
* @param envelope - Raw response envelope returned by the remote form endpoint.
|
|
497
|
+
* @returns An Error describing malformed form response data.
|
|
498
|
+
*/
|
|
499
|
+
var InvalidRemoteFormResponseError = class extends RuntimeError {
|
|
500
|
+
/**
|
|
501
|
+
* Raw response envelope returned by the remote form endpoint.
|
|
502
|
+
*
|
|
503
|
+
* @since 2.4.0
|
|
504
|
+
*/
|
|
505
|
+
envelope;
|
|
506
|
+
constructor(envelope) {
|
|
507
|
+
super("Invalid remote form response: expected an object envelope with a string type field returned by SvelteKit remote form transport.");
|
|
508
|
+
this.name = "InvalidRemoteFormResponseError";
|
|
509
|
+
this.envelope = envelope;
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
/**
|
|
513
|
+
* Thrown when a remote form response has a well-formed envelope but an
|
|
514
|
+
* unsupported response type or payload slot.
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* ```ts
|
|
518
|
+
* throw new UnsupportedRemoteFormResponseError(envelope);
|
|
519
|
+
* ```
|
|
520
|
+
*
|
|
521
|
+
* @since 2.4.0
|
|
522
|
+
* @param envelope - Raw response envelope returned by the remote form endpoint.
|
|
523
|
+
* @returns An Error describing unsupported form response data.
|
|
524
|
+
*/
|
|
525
|
+
var UnsupportedRemoteFormResponseError = class extends RuntimeError {
|
|
526
|
+
/**
|
|
527
|
+
* Raw response envelope returned by the remote form endpoint.
|
|
528
|
+
*
|
|
529
|
+
* @since 2.4.0
|
|
530
|
+
*/
|
|
531
|
+
envelope;
|
|
532
|
+
constructor(envelope) {
|
|
533
|
+
super("Unsupported remote form response: expected a result envelope with a devalue-encoded result or data string.");
|
|
534
|
+
this.name = "UnsupportedRemoteFormResponseError";
|
|
535
|
+
this.envelope = envelope;
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
/**
|
|
539
|
+
* Thrown when a serialized remote failure envelope cannot be decoded.
|
|
540
|
+
*
|
|
541
|
+
* @example
|
|
542
|
+
* ```ts
|
|
543
|
+
* throw new RemoteErrorDecodeError(raw);
|
|
544
|
+
* ```
|
|
545
|
+
*
|
|
546
|
+
* @since 2.4.0
|
|
547
|
+
* @param raw - Raw serialized remote failure payload that failed decoding.
|
|
548
|
+
* @returns An Error describing a malformed remote failure payload.
|
|
549
|
+
*/
|
|
550
|
+
var RemoteErrorDecodeError = class extends RuntimeError {
|
|
551
|
+
/**
|
|
552
|
+
* Raw serialized remote failure payload that failed decoding.
|
|
553
|
+
*
|
|
554
|
+
* @since 2.4.0
|
|
555
|
+
*/
|
|
556
|
+
raw;
|
|
557
|
+
constructor(raw) {
|
|
558
|
+
super("Failed to decode remote error payload: expected a devalue-encoded SER remote failure envelope compatible with the client decoder.");
|
|
559
|
+
this.name = "RemoteErrorDecodeError";
|
|
560
|
+
this.raw = raw;
|
|
561
|
+
}
|
|
562
|
+
};
|
|
563
|
+
/**
|
|
564
|
+
* Thrown when a root server-only helper is imported without Vite rewriting.
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* ```ts
|
|
568
|
+
* throw new ServerOnlyImportError("Query");
|
|
569
|
+
* ```
|
|
570
|
+
*
|
|
571
|
+
* @since 2.4.0
|
|
572
|
+
* @param export_name - Name of the server-only root export that was invoked.
|
|
573
|
+
* @returns An Error describing a missing server rewrite.
|
|
574
|
+
*/
|
|
575
|
+
var ServerOnlyImportError = class extends RuntimeError {
|
|
576
|
+
/**
|
|
577
|
+
* Name of the server-only root export that was invoked.
|
|
578
|
+
*
|
|
579
|
+
* @since 2.4.0
|
|
580
|
+
*/
|
|
581
|
+
export_name;
|
|
582
|
+
constructor(export_name) {
|
|
583
|
+
super(`${export_name} is only available in SvelteKit server files. Ensure the SER Vite plugin is enabled so root imports are rewritten to svelte-effect-runtime/server before execution.`);
|
|
584
|
+
this.name = "ServerOnlyImportError";
|
|
585
|
+
this.export_name = export_name;
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
/**
|
|
589
|
+
* Thrown when the publish-time `$app/server` shim executes outside SvelteKit.
|
|
590
|
+
*
|
|
591
|
+
* @example
|
|
592
|
+
* ```ts
|
|
593
|
+
* throw new SvelteKitServerExportUnavailableError("query");
|
|
594
|
+
* ```
|
|
595
|
+
*
|
|
596
|
+
* @since 2.4.0
|
|
597
|
+
* @param export_name - Name of the `$app/server` export that was invoked.
|
|
598
|
+
* @returns An Error describing an unavailable SvelteKit virtual module export.
|
|
599
|
+
*/
|
|
600
|
+
var SvelteKitServerExportUnavailableError = class extends RuntimeError {
|
|
601
|
+
/**
|
|
602
|
+
* Name of the `$app/server` export that was invoked.
|
|
603
|
+
*
|
|
604
|
+
* @since 2.4.0
|
|
605
|
+
*/
|
|
606
|
+
export_name;
|
|
607
|
+
constructor(export_name) {
|
|
608
|
+
super(`SvelteKit virtual $app/server export ${export_name} is only available inside a SvelteKit server module.`);
|
|
609
|
+
this.name = "SvelteKitServerExportUnavailableError";
|
|
610
|
+
this.export_name = export_name;
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
/**
|
|
614
|
+
* Thrown when a SvelteKit remote helper reports that it was called outside the
|
|
615
|
+
* route-scoped remote module context.
|
|
616
|
+
*
|
|
617
|
+
* @example
|
|
618
|
+
* ```ts
|
|
619
|
+
* throw new RemoteHelperContextError("Query");
|
|
620
|
+
* ```
|
|
621
|
+
*
|
|
622
|
+
* @since 2.4.0
|
|
623
|
+
* @param helper_name - SER helper name that triggered the context failure.
|
|
624
|
+
* @returns An Error describing the required `.remote.ts` placement.
|
|
625
|
+
*/
|
|
626
|
+
var RemoteHelperContextError = class extends RuntimeError {
|
|
627
|
+
/**
|
|
628
|
+
* SER helper name that triggered the context failure.
|
|
629
|
+
*
|
|
630
|
+
* @since 2.4.0
|
|
631
|
+
*/
|
|
632
|
+
helper_name;
|
|
633
|
+
constructor(helper_name) {
|
|
634
|
+
super(make_error_message("REMOTE_HELPER_CONTEXT", `${helper_name} was called outside a .remote.ts file. Ensure the file is named \`*.remote.ts\` and is located in a route directory so SvelteKit can bind remote helper context.`));
|
|
635
|
+
this.name = "RemoteHelperContextError";
|
|
636
|
+
this.helper_name = helper_name;
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
/**
|
|
640
|
+
* Thrown when a SvelteKit remote helper normalizes a non-Error thrown value.
|
|
641
|
+
*
|
|
642
|
+
* @example
|
|
643
|
+
* ```ts
|
|
644
|
+
* throw new RemoteHelperError("raw failure");
|
|
645
|
+
* ```
|
|
646
|
+
*
|
|
647
|
+
* @since 2.4.0
|
|
648
|
+
* @param value - Non-Error value thrown while creating a remote helper.
|
|
649
|
+
* @returns An Error preserving the remote helper failure value.
|
|
650
|
+
*/
|
|
651
|
+
var RemoteHelperError = class extends RuntimeError {
|
|
652
|
+
/**
|
|
653
|
+
* Non-Error value that was normalized.
|
|
654
|
+
*
|
|
655
|
+
* @since 2.4.0
|
|
656
|
+
*/
|
|
657
|
+
value;
|
|
658
|
+
constructor(value) {
|
|
659
|
+
super(make_error_message("REMOTE_HELPER_ERROR", String(value)));
|
|
660
|
+
this.name = "RemoteHelperError";
|
|
661
|
+
this.value = value;
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
/**
|
|
665
|
+
* Thrown when a non-Error value must be normalized into an Error instance.
|
|
666
|
+
*
|
|
667
|
+
* @example
|
|
668
|
+
* ```ts
|
|
669
|
+
* throw new UnknownRuntimeError("raw failure");
|
|
670
|
+
* ```
|
|
671
|
+
*
|
|
672
|
+
* @since 2.4.0
|
|
673
|
+
* @param value - Non-Error value that needs Error normalization.
|
|
674
|
+
* @returns An Error preserving the string representation of an unknown value.
|
|
675
|
+
*/
|
|
676
|
+
var UnknownRuntimeError = class extends RuntimeError {
|
|
677
|
+
/**
|
|
678
|
+
* Non-Error value that was normalized.
|
|
679
|
+
*
|
|
680
|
+
* @since 2.4.0
|
|
681
|
+
*/
|
|
682
|
+
value;
|
|
683
|
+
constructor(value) {
|
|
684
|
+
super(String(value));
|
|
685
|
+
this.name = "UnknownRuntimeError";
|
|
686
|
+
this.value = value;
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
//#endregion
|
|
690
|
+
export { UncheckedPrerenderHandlerMissingError as C, UnsupportedRemoteFormResponseError as D, UnsupportedMarkupEffectPositionError as E, YieldStarInEventCallbackError as O, UncheckedLiveQueryHandlerMissingError as S, UnknownRuntimeError as T, RuntimeError as _, DispatcherDisposedError as a, UncheckedCommandHandlerMissingError as b, InvalidLiveQueryReturnError as c, PreprocessError as d, RemoteErrorDecodeError as f, RequestEventUnavailableError as g, RemoteHelperError as h, BatchQueryHandlerMissingError as i, InvalidQueryFactoryError as l, RemoteHelperContextError as m, AsyncEffectInSyncRuneError as n, InvalidCommandFactoryError as o, RemoteFormEndpointMissingError as p, AwaitInEffectWorkError as r, InvalidLiveQueryFactoryError as s, AsyncEffectInEventCallbackError as t, InvalidRemoteFormResponseError as u, ServerOnlyImportError as v, UncheckedQueryHandlerMissingError as w, UncheckedFormHandlerMissingError as x, SvelteKitServerExportUnavailableError as y };
|
|
691
|
+
|
|
692
|
+
//# sourceMappingURL=errors-DppSJ83S.js.map
|