You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/svelte/src/internal/client/errors.js
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -263,65 +263,65 @@ export function rune_outside_svelte(rune) {
263
263
}
264
264
265
265
/**
266
-
* Cannot set prototype of `$state` object
266
+
* The argument to `$state.frozen(...)` cannot be an object created with `$state(...)`. You should create a copy of it first, for example with `$state.snapshot`
267
267
* @returns {never}
268
268
*/
269
-
exportfunctionstate_prototype_fixed(){
269
+
exportfunctionstate_frozen_invalid_argument(){
270
270
if(DEV){
271
-
consterror=newError(`state_prototype_fixed\nCannot set prototype of \`$state\` object`);
271
+
consterror=newError(`state_frozen_invalid_argument\nThe argument to \`$state.frozen(...)\` cannot be an object created with \`$state(...)\`. You should create a copy of it first, for example with \`$state.snapshot\``);
272
272
273
273
error.name='Svelte error';
274
274
throwerror;
275
275
}else{
276
276
// TODO print a link to the documentation
277
-
thrownewError("state_prototype_fixed");
277
+
thrownewError("state_frozen_invalid_argument");
278
278
}
279
279
}
280
280
281
281
/**
282
-
* Updating state inside a derived is forbidden. If the value should not be reactive, declare it without `$state`
282
+
* Cannot set prototype of `$state` object
283
283
* @returns {never}
284
284
*/
285
-
exportfunctionstate_unsafe_mutation(){
285
+
exportfunctionstate_prototype_fixed(){
286
286
if(DEV){
287
-
consterror=newError(`state_unsafe_mutation\nUpdating state inside a derived is forbidden. If the value should not be reactive, declare it without \`$state\``);
287
+
consterror=newError(`state_prototype_fixed\nCannot set prototype of \`$state\` object`);
288
288
289
289
error.name='Svelte error';
290
290
throwerror;
291
291
}else{
292
292
// TODO print a link to the documentation
293
-
thrownewError("state_unsafe_mutation");
293
+
thrownewError("state_prototype_fixed");
294
294
}
295
295
}
296
296
297
297
/**
298
-
* The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined
298
+
* Updating state inside a derived is forbidden. If the value should not be reactive, declare it without `$state`
consterror=newError(`svelte_component_invalid_this_value\nThe \`this={...}\` property of a \`<svelte:component>\` must be a Svelte component, if defined`);
303
+
consterror=newError(`state_unsafe_mutation\nUpdating state inside a derived is forbidden. If the value should not be reactive, declare it without \`$state\``);
* The argument to `$state.frozen(...)` cannot be an object created with `$state(...)`. You should create a copy of it first, for example with `$state.snapshot`
314
+
* The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined
consterror=newError(`state_frozen_invalid_argument\nThe argument to \`$state.frozen(...)\` cannot be an object created with \`$state(...)\`. You should create a copy of it first, for example with \`$state.snapshot\``);
319
+
consterror=newError(`svelte_component_invalid_this_value\nThe \`this={...}\` property of a \`<svelte:component>\` must be a Svelte component, if defined`);
0 commit comments