mirror of https://github.com/sveltejs/svelte
chore: markdown runtime errors/warnings (#11304)
* chore: markdown runtime warnings * on second thoughts * start adding errors too * lint * centralisepull/11311/head
parent
880886061d
commit
94b4268ce3
@ -0,0 +1,3 @@
|
|||||||
|
## effect_update_depth_exceeded
|
||||||
|
|
||||||
|
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
|
@ -0,0 +1,7 @@
|
|||||||
|
## lifecycle_outside_component
|
||||||
|
|
||||||
|
`%name%(...)` can only be used during component initialisation
|
||||||
|
|
||||||
|
## lifecycle_legacy_only
|
||||||
|
|
||||||
|
`%name%(...)` cannot be used in runes mode
|
@ -0,0 +1,7 @@
|
|||||||
|
## lifecycle_double_unmount
|
||||||
|
|
||||||
|
Tried to unmount a component that was not mounted
|
||||||
|
|
||||||
|
## ownership_invalid_binding
|
||||||
|
|
||||||
|
%parent% passed a value to %child% with `bind:`, but the value is owned by %owner%. Consider creating a binding between %owner% and %parent%
|
@ -0,0 +1,3 @@
|
|||||||
|
## dynamic_void_element_content
|
||||||
|
|
||||||
|
`<svelte:element this="%tag%">` is a void element — it cannot have content
|
@ -0,0 +1,17 @@
|
|||||||
|
import { DEV } from 'esm-env';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MESSAGE
|
||||||
|
* @param {string} PARAMETER
|
||||||
|
* @returns {never}
|
||||||
|
*/
|
||||||
|
export function CODE(PARAMETER) {
|
||||||
|
if (DEV) {
|
||||||
|
const error = new Error(`${'CODE'}\n${MESSAGE}`);
|
||||||
|
error.name = 'Svelte error';
|
||||||
|
throw error;
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
throw new Error('CODE');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
import { DEV } from 'esm-env';
|
||||||
|
|
||||||
|
var bold = 'font-weight: bold';
|
||||||
|
var normal = 'font-weight: normal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MESSAGE
|
||||||
|
* @param {string} PARAMETER
|
||||||
|
*/
|
||||||
|
export function CODE(PARAMETER) {
|
||||||
|
if (DEV) {
|
||||||
|
console.warn(`%c[svelte] ${'CODE'}\n%c${MESSAGE}`, bold, normal);
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
console.warn('CODE');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
import { DEV } from 'esm-env';
|
||||||
|
|
||||||
|
var bold = 'font-weight: bold';
|
||||||
|
var normal = 'font-weight: normal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MESSAGE
|
||||||
|
* @param {boolean} trace
|
||||||
|
* @param {string} PARAMETER
|
||||||
|
*/
|
||||||
|
export function CODE(trace, PARAMETER) {
|
||||||
|
if (DEV) {
|
||||||
|
console.warn(`%c[svelte] ${'CODE'}\n%c${MESSAGE}`, bold, normal);
|
||||||
|
if (trace) console.trace('stack trace');
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
console.warn('CODE');
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
/* This file is generated by scripts/process-messages.js. Do not edit! */
|
||||||
|
|
||||||
|
import { DEV } from 'esm-env';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
|
||||||
|
* @returns {never}
|
||||||
|
*/
|
||||||
|
export function effect_update_depth_exceeded() {
|
||||||
|
if (DEV) {
|
||||||
|
const error = new Error(`${"effect_update_depth_exceeded"}\n${"Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops"}`);
|
||||||
|
|
||||||
|
error.name = 'Svelte error';
|
||||||
|
throw error;
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
throw new Error("effect_update_depth_exceeded");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `%name%(...)` can only be used during component initialisation
|
||||||
|
* @param {string} name
|
||||||
|
* @returns {never}
|
||||||
|
*/
|
||||||
|
export function lifecycle_outside_component(name) {
|
||||||
|
if (DEV) {
|
||||||
|
const error = new Error(`${"lifecycle_outside_component"}\n${`\`${name}(...)\` can only be used during component initialisation`}`);
|
||||||
|
|
||||||
|
error.name = 'Svelte error';
|
||||||
|
throw error;
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
throw new Error("lifecycle_outside_component");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `%name%(...)` cannot be used in runes mode
|
||||||
|
* @param {string} name
|
||||||
|
* @returns {never}
|
||||||
|
*/
|
||||||
|
export function lifecycle_legacy_only(name) {
|
||||||
|
if (DEV) {
|
||||||
|
const error = new Error(`${"lifecycle_legacy_only"}\n${`\`${name}(...)\` cannot be used in runes mode`}`);
|
||||||
|
|
||||||
|
error.name = 'Svelte error';
|
||||||
|
throw error;
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
throw new Error("lifecycle_legacy_only");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
/* This file is generated by scripts/process-messages.js. Do not edit! */
|
||||||
|
|
||||||
|
import { DEV } from 'esm-env';
|
||||||
|
|
||||||
|
var bold = 'font-weight: bold';
|
||||||
|
var normal = 'font-weight: normal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tried to unmount a component that was not mounted
|
||||||
|
*/
|
||||||
|
export function lifecycle_double_unmount() {
|
||||||
|
if (DEV) {
|
||||||
|
console.warn(`%c[svelte] ${"lifecycle_double_unmount"}\n%c${"Tried to unmount a component that was not mounted"}`, bold, normal);
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
console.warn("lifecycle_double_unmount");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* %parent% passed a value to %child% with `bind:`, but the value is owned by %owner%. Consider creating a binding between %owner% and %parent%
|
||||||
|
* @param {string} parent
|
||||||
|
* @param {string} child
|
||||||
|
* @param {string} owner
|
||||||
|
*/
|
||||||
|
export function ownership_invalid_binding(parent, child, owner) {
|
||||||
|
if (DEV) {
|
||||||
|
console.warn(`%c[svelte] ${"ownership_invalid_binding"}\n%c${`${parent} passed a value to ${child} with \`bind:\`, but the value is owned by ${owner}. Consider creating a binding between ${owner} and ${parent}`}`, bold, normal);
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
console.warn("ownership_invalid_binding");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
/* This file is generated by scripts/process-messages.js. Do not edit! */
|
||||||
|
|
||||||
|
import { DEV } from 'esm-env';
|
||||||
|
|
||||||
|
var bold = 'font-weight: bold';
|
||||||
|
var normal = 'font-weight: normal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `<svelte:element this="%tag%">` is a void element — it cannot have content
|
||||||
|
* @param {boolean} trace
|
||||||
|
* @param {string} tag
|
||||||
|
*/
|
||||||
|
export function dynamic_void_element_content(trace, tag) {
|
||||||
|
if (DEV) {
|
||||||
|
console.warn(`%c[svelte] ${"dynamic_void_element_content"}\n%c${`\`<svelte:element this="${tag}">\` is a void element — it cannot have content`}`, bold, normal);
|
||||||
|
if (trace) console.trace('stack trace');
|
||||||
|
} else {
|
||||||
|
// TODO print a link to the documentation
|
||||||
|
console.warn("dynamic_void_element_content");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue