* chore: provide links to documentation for errors/warnings
closes#11305
* changeset
* fix most of the tests
* fix mutations messing with nodes between runs
* more concise
* more test fixes
* last one
w(node,"a11y_aria_activedescendant_has_tabindex","An element with an aria-activedescendant attribute should have a tabindex value");
w(node,"a11y_aria_activedescendant_has_tabindex",`An element with an aria-activedescendant attribute should have a tabindex value\nhttps://svelte.dev/e/a11y_aria_activedescendant_has_tabindex`);
}
/**
@ -146,7 +146,7 @@ export function a11y_aria_activedescendant_has_tabindex(node) {
*@param{string}name
*/
exportfunctiona11y_aria_attributes(node,name){
w(node,"a11y_aria_attributes",`\`<${name}>\` should not have aria-* attributes`);
w(node,"a11y_aria_attributes",`\`<${name}>\` should not have aria-* attributes\nhttps://svelte.dev/e/a11y_aria_attributes`);
}
/**
@ -156,7 +156,7 @@ export function a11y_aria_attributes(node, name) {
w(node,"a11y_autocomplete_valid",`'${value}' is an invalid value for 'autocomplete' on \`<input type="${type}">\``);
w(node,"a11y_autocomplete_valid",`'${value}' is an invalid value for 'autocomplete' on \`<input type="${type}">\`\nhttps://svelte.dev/e/a11y_autocomplete_valid`);
}
/**
@ -164,7 +164,7 @@ export function a11y_autocomplete_valid(node, value, type) {
*@param{null|NodeLike}node
*/
exportfunctiona11y_autofocus(node){
w(node,"a11y_autofocus","Avoid using autofocus");
w(node,"a11y_autofocus",`Avoid using autofocus\nhttps://svelte.dev/e/a11y_autofocus`);
}
/**
@ -172,7 +172,7 @@ export function a11y_autofocus(node) {
w(node,"a11y_click_events_have_key_events","Visible, non-interactive elements with a click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as `<button type=\"button\">` or `<a>` might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details");
w(node,"a11y_click_events_have_key_events",`Visible, non-interactive elements with a click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as \`<button type="button">\` or \`<a>\` might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details\nhttps://svelte.dev/e/a11y_click_events_have_key_events`);
}
/**
@ -180,7 +180,7 @@ export function a11y_click_events_have_key_events(node) {
*@param{null|NodeLike}node
*/
exportfunctiona11y_consider_explicit_label(node){
w(node,"a11y_consider_explicit_label","Buttons and links should either contain text or have an `aria-label` or `aria-labelledby` attribute");
w(node,"a11y_consider_explicit_label",`Buttons and links should either contain text or have an \`aria-label\` or \`aria-labelledby\` attribute\nhttps://svelte.dev/e/a11y_consider_explicit_label`);
}
/**
@ -189,7 +189,7 @@ export function a11y_consider_explicit_label(node) {
w(node,"a11y_incorrect_aria_attribute_type_boolean",`The value of '${attribute}' must be either 'true' or 'false'. It cannot be empty`);
w(node,"a11y_incorrect_aria_attribute_type_boolean",`The value of '${attribute}' must be either 'true' or 'false'. It cannot be empty\nhttps://svelte.dev/e/a11y_incorrect_aria_attribute_type_boolean`);
}
/**
@ -250,7 +250,7 @@ export function a11y_incorrect_aria_attribute_type_boolean(node, attribute) {
w(node,"a11y_incorrect_aria_attribute_type_id",`The value of '${attribute}' must be a string that represents a DOM element ID`);
w(node,"a11y_incorrect_aria_attribute_type_id",`The value of '${attribute}' must be a string that represents a DOM element ID\nhttps://svelte.dev/e/a11y_incorrect_aria_attribute_type_id`);
}
/**
@ -259,7 +259,7 @@ export function a11y_incorrect_aria_attribute_type_id(node, attribute) {
w(node,"a11y_incorrect_aria_attribute_type_idlist",`The value of '${attribute}' must be a space-separated list of strings that represent DOM element IDs`);
w(node,"a11y_incorrect_aria_attribute_type_idlist",`The value of '${attribute}' must be a space-separated list of strings that represent DOM element IDs\nhttps://svelte.dev/e/a11y_incorrect_aria_attribute_type_idlist`);
}
/**
@ -268,7 +268,7 @@ export function a11y_incorrect_aria_attribute_type_idlist(node, attribute) {
w(node,"a11y_incorrect_aria_attribute_type_integer",`The value of '${attribute}' must be an integer`);
w(node,"a11y_incorrect_aria_attribute_type_integer",`The value of '${attribute}' must be an integer\nhttps://svelte.dev/e/a11y_incorrect_aria_attribute_type_integer`);
}
/**
@ -278,7 +278,7 @@ export function a11y_incorrect_aria_attribute_type_integer(node, attribute) {
w(node,"a11y_incorrect_aria_attribute_type_token",`The value of '${attribute}' must be exactly one of ${values}`);
w(node,"a11y_incorrect_aria_attribute_type_token",`The value of '${attribute}' must be exactly one of ${values}\nhttps://svelte.dev/e/a11y_incorrect_aria_attribute_type_token`);
}
/**
@ -288,7 +288,7 @@ export function a11y_incorrect_aria_attribute_type_token(node, attribute, values
w(node,"a11y_incorrect_aria_attribute_type_tokenlist",`The value of '${attribute}' must be a space-separated list of one or more of ${values}`);
w(node,"a11y_incorrect_aria_attribute_type_tokenlist",`The value of '${attribute}' must be a space-separated list of one or more of ${values}\nhttps://svelte.dev/e/a11y_incorrect_aria_attribute_type_tokenlist`);
}
/**
@ -297,7 +297,7 @@ export function a11y_incorrect_aria_attribute_type_tokenlist(node, attribute, va
w(node,"a11y_incorrect_aria_attribute_type_tristate",`The value of '${attribute}' must be exactly one of true, false, or mixed`);
w(node,"a11y_incorrect_aria_attribute_type_tristate",`The value of '${attribute}' must be exactly one of true, false, or mixed\nhttps://svelte.dev/e/a11y_incorrect_aria_attribute_type_tristate`);
}
/**
@ -306,7 +306,7 @@ export function a11y_incorrect_aria_attribute_type_tristate(node, attribute) {
w(node,"a11y_interactive_supports_focus",`Elements with the '${role}' interactive role must have a tabindex value`);
w(node,"a11y_interactive_supports_focus",`Elements with the '${role}' interactive role must have a tabindex value\nhttps://svelte.dev/e/a11y_interactive_supports_focus`);
}
/**
@ -316,7 +316,7 @@ export function a11y_interactive_supports_focus(node, role) {
w(node,"a11y_mouse_events_have_key_events",`'${event}' event must be accompanied by '${accompanied_by}' event`);
w(node,"a11y_mouse_events_have_key_events",`'${event}' event must be accompanied by '${accompanied_by}' event\nhttps://svelte.dev/e/a11y_mouse_events_have_key_events`);
}
/**
@ -388,7 +388,7 @@ export function a11y_mouse_events_have_key_events(node, event, accompanied_by) {
*@param{string}role
*/
exportfunctiona11y_no_abstract_role(node,role){
w(node,"a11y_no_abstract_role",`Abstract role '${role}' is forbidden`);
w(node,"a11y_no_abstract_role",`Abstract role '${role}' is forbidden\nhttps://svelte.dev/e/a11y_no_abstract_role`);
}
/**
@ -398,7 +398,7 @@ export function a11y_no_abstract_role(node, role) {
w(node,"a11y_no_interactive_element_to_noninteractive_role",`\`<${element}>\` cannot have role '${role}'`);
w(node,"a11y_no_interactive_element_to_noninteractive_role",`\`<${element}>\` cannot have role '${role}'\nhttps://svelte.dev/e/a11y_no_interactive_element_to_noninteractive_role`);
}
/**
@ -407,7 +407,7 @@ export function a11y_no_interactive_element_to_noninteractive_role(node, element
w(node,"a11y_no_noninteractive_element_interactions",`Non-interactive element \`<${element}>\` should not be assigned mouse or keyboard event listeners`);
w(node,"a11y_no_noninteractive_element_interactions",`Non-interactive element \`<${element}>\` should not be assigned mouse or keyboard event listeners\nhttps://svelte.dev/e/a11y_no_noninteractive_element_interactions`);
}
/**
@ -417,7 +417,7 @@ export function a11y_no_noninteractive_element_interactions(node, element) {
w(node,"a11y_no_noninteractive_element_to_interactive_role",`Non-interactive element \`<${element}>\` cannot have interactive role '${role}'`);
w(node,"a11y_no_noninteractive_element_to_interactive_role",`Non-interactive element \`<${element}>\` cannot have interactive role '${role}'\nhttps://svelte.dev/e/a11y_no_noninteractive_element_to_interactive_role`);
}
/**
@ -425,7 +425,7 @@ export function a11y_no_noninteractive_element_to_interactive_role(node, element
w(node,"a11y_no_noninteractive_tabindex","noninteractive element cannot have nonnegative tabIndex value");
w(node,"a11y_no_noninteractive_tabindex",`noninteractive element cannot have nonnegative tabIndex value\nhttps://svelte.dev/e/a11y_no_noninteractive_tabindex`);
}
/**
@ -434,7 +434,7 @@ export function a11y_no_noninteractive_tabindex(node) {
*@param{string}role
*/
exportfunctiona11y_no_redundant_roles(node,role){
w(node,"a11y_no_redundant_roles",`Redundant role '${role}'`);
w(node,"a11y_no_redundant_roles",`Redundant role '${role}'\nhttps://svelte.dev/e/a11y_no_redundant_roles`);
}
/**
@ -444,7 +444,7 @@ export function a11y_no_redundant_roles(node, role) {
w(node,"a11y_no_static_element_interactions",`\`<${element}>\` with a ${handler} handler must have an ARIA role`);
w(node,"a11y_no_static_element_interactions",`\`<${element}>\` with a ${handler} handler must have an ARIA role\nhttps://svelte.dev/e/a11y_no_static_element_interactions`);
}
/**
@ -452,7 +452,7 @@ export function a11y_no_static_element_interactions(node, element, handler) {
w(node,"a11y_role_has_required_aria_props",`Elements with the ARIA role "${role}" must have the following attributes defined: ${props}`);
w(node,"a11y_role_has_required_aria_props",`Elements with the ARIA role "${role}" must have the following attributes defined: ${props}\nhttps://svelte.dev/e/a11y_role_has_required_aria_props`);
}
/**
@ -472,7 +472,7 @@ export function a11y_role_has_required_aria_props(node, role, props) {
w(node,"a11y_role_supports_aria_props",`The attribute '${attribute}' is not supported by the role '${role}'`);
w(node,"a11y_role_supports_aria_props",`The attribute '${attribute}' is not supported by the role '${role}'\nhttps://svelte.dev/e/a11y_role_supports_aria_props`);
}
/**
@ -483,7 +483,7 @@ export function a11y_role_supports_aria_props(node, attribute, role) {
w(node,"a11y_role_supports_aria_props_implicit",`The attribute '${attribute}' is not supported by the role '${role}'. This role is implicit on the element \`<${name}>\``);
w(node,"a11y_role_supports_aria_props_implicit",`The attribute '${attribute}' is not supported by the role '${role}'. This role is implicit on the element \`<${name}>\`\nhttps://svelte.dev/e/a11y_role_supports_aria_props_implicit`);
}
/**
@ -493,7 +493,7 @@ export function a11y_role_supports_aria_props_implicit(node, attribute, role, na
w(node,"a11y_unknown_aria_attribute",suggestion?`Unknown aria attribute 'aria-${attribute}'. Did you mean '${suggestion}'?`:`Unknown aria attribute 'aria-${attribute}'`);
w(node,"a11y_unknown_aria_attribute",`${suggestion?`Unknown aria attribute 'aria-${attribute}'. Did you mean '${suggestion}'?`:`Unknown aria attribute 'aria-${attribute}'`}\nhttps://svelte.dev/e/a11y_unknown_aria_attribute`);
}
/**
@ -503,7 +503,7 @@ export function a11y_unknown_aria_attribute(node, attribute, suggestion) {
w(node,"a11y_unknown_role",suggestion?`Unknown role '${role}'. Did you mean '${suggestion}'?`:`Unknown role '${role}'`);
w(node,"a11y_unknown_role",`${suggestion?`Unknown role '${role}'. Did you mean '${suggestion}'?`:`Unknown role '${role}'`}\nhttps://svelte.dev/e/a11y_unknown_role`);
}
/**
@ -513,7 +513,7 @@ export function a11y_unknown_role(node, role, suggestion) {
*@param{string}suggestion
*/
exportfunctionlegacy_code(node,code,suggestion){
w(node,"legacy_code",`\`${code}\` is no longer valid — please use \`${suggestion}\` instead`);
w(node,"legacy_code",`\`${code}\` is no longer valid — please use \`${suggestion}\` instead\nhttps://svelte.dev/e/legacy_code`);
}
/**
@ -523,7 +523,7 @@ export function legacy_code(node, code, suggestion) {
*@param{string|undefined|null}[suggestion]
*/
exportfunctionunknown_code(node,code,suggestion){
w(node,"unknown_code",suggestion?`\`${code}\` is not a recognised code (did you mean \`${suggestion}\`?)`:`\`${code}\` is not a recognised code`);
w(node,"unknown_code",`${suggestion?`\`${code}\` is not a recognised code (did you mean \`${suggestion}\`?)`:`\`${code}\` is not a recognised code`}\nhttps://svelte.dev/e/unknown_code`);
}
/**
@ -531,7 +531,7 @@ export function unknown_code(node, code, suggestion) {
*@param{null|NodeLike}node
*/
exportfunctionoptions_deprecated_accessors(node){
w(node,"options_deprecated_accessors","The `accessors` option has been deprecated. It will have no effect in runes mode");
w(node,"options_deprecated_accessors",`The \`accessors\` option has been deprecated. It will have no effect in runes mode\nhttps://svelte.dev/e/options_deprecated_accessors`);
}
/**
@ -539,7 +539,7 @@ export function options_deprecated_accessors(node) {
*@param{null|NodeLike}node
*/
exportfunctionoptions_deprecated_immutable(node){
w(node,"options_deprecated_immutable","The `immutable` option has been deprecated. It will have no effect in runes mode");
w(node,"options_deprecated_immutable",`The \`immutable\` option has been deprecated. It will have no effect in runes mode\nhttps://svelte.dev/e/options_deprecated_immutable`);
}
/**
@ -547,7 +547,7 @@ export function options_deprecated_immutable(node) {
w(node,"options_missing_custom_element","The `customElement` option is used when generating a custom element. Did you forget the `customElement: true` compile option?");
w(node,"options_missing_custom_element",`The \`customElement\` option is used when generating a custom element. Did you forget the \`customElement: true\` compile option?\nhttps://svelte.dev/e/options_missing_custom_element`);
}
/**
@ -555,7 +555,7 @@ export function options_missing_custom_element(node) {
w(node,"options_removed_enable_sourcemap","The `enableSourcemap` option has been removed. Source maps are always generated now, and tooling can choose to ignore them");
w(node,"options_removed_enable_sourcemap",`The \`enableSourcemap\` option has been removed. Source maps are always generated now, and tooling can choose to ignore them\nhttps://svelte.dev/e/options_removed_enable_sourcemap`);
}
/**
@ -563,7 +563,7 @@ export function options_removed_enable_sourcemap(node) {
*@param{null|NodeLike}node
*/
exportfunctionoptions_removed_hydratable(node){
w(node,"options_removed_hydratable","The `hydratable` option has been removed. Svelte components are always hydratable now");
w(node,"options_removed_hydratable",`The \`hydratable\` option has been removed. Svelte components are always hydratable now\nhttps://svelte.dev/e/options_removed_hydratable`);
}
/**
@ -571,7 +571,7 @@ export function options_removed_hydratable(node) {
w(node,"options_removed_loop_guard_timeout","The `loopGuardTimeout` option has been removed");
w(node,"options_removed_loop_guard_timeout",`The \`loopGuardTimeout\` option has been removed\nhttps://svelte.dev/e/options_removed_loop_guard_timeout`);
}
/**
@ -579,7 +579,7 @@ export function options_removed_loop_guard_timeout(node) {
*@param{null|NodeLike}node
*/
exportfunctionoptions_renamed_ssr_dom(node){
w(node,"options_renamed_ssr_dom","`generate: \"dom\"` and `generate: \"ssr\"` options have been renamed to \"client\" and \"server\" respectively");
w(node,"options_renamed_ssr_dom",`\`generate: "dom"\` and \`generate: "ssr"\` options have been renamed to "client" and "server" respectively\nhttps://svelte.dev/e/options_renamed_ssr_dom`);
}
/**
@ -588,7 +588,7 @@ export function options_renamed_ssr_dom(node) {
*@param{string}name
*/
exportfunctionexport_let_unused(node,name){
w(node,"export_let_unused",`Component has unused export property '${name}'. If it is for external reference only, please consider using \`export const ${name}\``);
w(node,"export_let_unused",`Component has unused export property '${name}'. If it is for external reference only, please consider using \`export const ${name}\`\nhttps://svelte.dev/e/export_let_unused`);
}
/**
@ -596,7 +596,7 @@ export function export_let_unused(node, name) {
*@param{null|NodeLike}node
*/
exportfunctionlegacy_component_creation(node){
w(node,"legacy_component_creation","Svelte 5 components are no longer classes. Instantiate them using `mount` or `hydrate` (imported from 'svelte') instead.");
w(node,"legacy_component_creation",`Svelte 5 components are no longer classes. Instantiate them using \`mount\` or \`hydrate\` (imported from 'svelte') instead.\nhttps://svelte.dev/e/legacy_component_creation`);
}
/**
@ -605,7 +605,7 @@ export function legacy_component_creation(node) {
*@param{string}name
*/
exportfunctionnon_reactive_update(node,name){
w(node,"non_reactive_update",`\`${name}\` is updated, but is not declared with \`$state(...)\`. Changing its value will not correctly trigger updates`);
w(node,"non_reactive_update",`\`${name}\` is updated, but is not declared with \`$state(...)\`. Changing its value will not correctly trigger updates\nhttps://svelte.dev/e/non_reactive_update`);
}
/**
@ -613,7 +613,7 @@ export function non_reactive_update(node, name) {
*@param{null|NodeLike}node
*/
exportfunctionperf_avoid_inline_class(node){
w(node,"perf_avoid_inline_class","Avoid 'new class' — instead, declare the class at the top level scope");
w(node,"perf_avoid_inline_class",`Avoid 'new class' — instead, declare the class at the top level scope\nhttps://svelte.dev/e/perf_avoid_inline_class`);
}
/**
@ -621,7 +621,7 @@ export function perf_avoid_inline_class(node) {
*@param{null|NodeLike}node
*/
exportfunctionperf_avoid_nested_class(node){
w(node,"perf_avoid_nested_class","Avoid declaring classes below the top level scope");
w(node,"perf_avoid_nested_class",`Avoid declaring classes below the top level scope\nhttps://svelte.dev/e/perf_avoid_nested_class`);
}
/**
@ -629,7 +629,7 @@ export function perf_avoid_nested_class(node) {
w(node,"reactive_declaration_invalid_placement","Reactive declarations only exist at the top level of the instance script");
w(node,"reactive_declaration_invalid_placement",`Reactive declarations only exist at the top level of the instance script\nhttps://svelte.dev/e/reactive_declaration_invalid_placement`);
}
/**
@ -637,7 +637,7 @@ export function reactive_declaration_invalid_placement(node) {
w(node,"reactive_declaration_module_script_dependency","Reassignments of module-level declarations will not cause reactive statements to update");
w(node,"reactive_declaration_module_script_dependency",`Reassignments of module-level declarations will not cause reactive statements to update\nhttps://svelte.dev/e/reactive_declaration_module_script_dependency`);
}
/**
@ -645,7 +645,7 @@ export function reactive_declaration_module_script_dependency(node) {
*@param{null|NodeLike}node
*/
exportfunctionstate_referenced_locally(node){
w(node,"state_referenced_locally","State referenced in its own scope will never update. Did you mean to reference it inside a closure?");
w(node,"state_referenced_locally",`State referenced in its own scope will never update. Did you mean to reference it inside a closure?\nhttps://svelte.dev/e/state_referenced_locally`);
}
/**
@ -654,7 +654,7 @@ export function state_referenced_locally(node) {
*@param{string}name
*/
exportfunctionstore_rune_conflict(node,name){
w(node,"store_rune_conflict",`It looks like you're using the \`$${name}\` rune, but there is a local binding called \`${name}\`. Referencing a local variable with a \`$\` prefix will create a store subscription. Please rename \`${name}\` to avoid the ambiguity`);
w(node,"store_rune_conflict",`It looks like you're using the \`$${name}\` rune, but there is a local binding called \`${name}\`. Referencing a local variable with a \`$\` prefix will create a store subscription. Please rename \`${name}\` to avoid the ambiguity\nhttps://svelte.dev/e/store_rune_conflict`);
}
/**
@ -663,7 +663,7 @@ export function store_rune_conflict(node, name) {
w(node,"attribute_global_event_reference",`You are referencing \`globalThis.${name}\`. Did you forget to declare a variable with that name?`);
w(node,"attribute_global_event_reference",`You are referencing \`globalThis.${name}\`. Did you forget to declare a variable with that name?\nhttps://svelte.dev/e/attribute_global_event_reference`);
}
/**
@ -688,7 +688,7 @@ export function attribute_global_event_reference(node, name) {
*@param{null|NodeLike}node
*/
exportfunctionattribute_illegal_colon(node){
w(node,"attribute_illegal_colon","Attributes should not contain ':' characters to prevent ambiguity with Svelte directives");
w(node,"attribute_illegal_colon",`Attributes should not contain ':' characters to prevent ambiguity with Svelte directives\nhttps://svelte.dev/e/attribute_illegal_colon`);
}
/**
@ -698,7 +698,7 @@ export function attribute_illegal_colon(node) {
w(node,"attribute_invalid_property_name",`'${wrong}' is not a valid HTML attribute. Did you mean '${right}'?`);
w(node,"attribute_invalid_property_name",`'${wrong}' is not a valid HTML attribute. Did you mean '${right}'?\nhttps://svelte.dev/e/attribute_invalid_property_name`);
}
/**
@ -706,7 +706,7 @@ export function attribute_invalid_property_name(node, wrong, right) {
*@param{null|NodeLike}node
*/
exportfunctionattribute_quoted(node){
w(node,"attribute_quoted","Quoted attributes on components and custom elements will be stringified in a future version of Svelte. If this isn't what you want, remove the quotes");
w(node,"attribute_quoted",`Quoted attributes on components and custom elements will be stringified in a future version of Svelte. If this isn't what you want, remove the quotes\nhttps://svelte.dev/e/attribute_quoted`);
}
/**
@ -715,7 +715,7 @@ export function attribute_quoted(node) {
*@param{string}name
*/
exportfunctionbind_invalid_each_rest(node,name){
w(node,"bind_invalid_each_rest",`The rest operator (...) will create a new object and binding '${name}' with the original object will not work`);
w(node,"bind_invalid_each_rest",`The rest operator (...) will create a new object and binding '${name}' with the original object will not work\nhttps://svelte.dev/e/bind_invalid_each_rest`);
}
/**
@ -723,7 +723,7 @@ export function bind_invalid_each_rest(node, name) {
w(node,"component_name_lowercase",`\`<${name}>\` will be treated as an HTML element unless it begins with a capital letter`);
w(node,"component_name_lowercase",`\`<${name}>\` will be treated as an HTML element unless it begins with a capital letter\nhttps://svelte.dev/e/component_name_lowercase`);
}
/**
@ -741,7 +741,7 @@ export function component_name_lowercase(node, name) {
w(node,"element_invalid_self_closing_tag",`Self-closing HTML tags for non-void elements are ambiguous — use \`<${name} ...></${name}>\` rather than \`<${name} ... />\``);
w(node,"element_invalid_self_closing_tag",`Self-closing HTML tags for non-void elements are ambiguous — use \`<${name} ...></${name}>\` rather than \`<${name} ... />\`\nhttps://svelte.dev/e/element_invalid_self_closing_tag`);
}
/**
@ -750,7 +750,7 @@ export function element_invalid_self_closing_tag(node, name) {
w(node,"event_directive_deprecated",`Using \`on:${name}\` to listen to the ${name} event is deprecated. Use the event attribute \`on${name}\` instead`);
w(node,"event_directive_deprecated",`Using \`on:${name}\` to listen to the ${name} event is deprecated. Use the event attribute \`on${name}\` instead\nhttps://svelte.dev/e/event_directive_deprecated`);
}
/**
@ -759,7 +759,7 @@ export function event_directive_deprecated(node, name) {
w(node,"node_invalid_placement_ssr",`${message}. When rendering this component on the server, the resulting HTML will be modified by the browser (by moving, removing, or inserting elements), likely resulting in a \`hydration_mismatch\` warning`);
w(node,"node_invalid_placement_ssr",`${message}. When rendering this component on the server, the resulting HTML will be modified by the browser (by moving, removing, or inserting elements), likely resulting in a \`hydration_mismatch\` warning\nhttps://svelte.dev/e/node_invalid_placement_ssr`);
}
/**
@ -767,7 +767,7 @@ export function node_invalid_placement_ssr(node, message) {
*@param{null|NodeLike}node
*/
exportfunctionscript_context_deprecated(node){
w(node,"script_context_deprecated","`context=\"module\"` is deprecated, use the `module` attribute instead");
w(node,"script_context_deprecated",`\`context="module"\` is deprecated, use the \`module\` attribute instead\nhttps://svelte.dev/e/script_context_deprecated`);
}
/**
@ -775,7 +775,7 @@ export function script_context_deprecated(node) {
*@param{null|NodeLike}node
*/
exportfunctionscript_unknown_attribute(node){
w(node,"script_unknown_attribute","Unrecognized attribute — should be one of `generics`, `lang` or `module`. If this exists for a preprocessor, ensure that the preprocessor removes it");
w(node,"script_unknown_attribute",`Unrecognized attribute — should be one of \`generics\`, \`lang\` or \`module\`. If this exists for a preprocessor, ensure that the preprocessor removes it\nhttps://svelte.dev/e/script_unknown_attribute`);
}
/**
@ -783,7 +783,7 @@ export function script_unknown_attribute(node) {
*@param{null|NodeLike}node
*/
exportfunctionslot_element_deprecated(node){
w(node,"slot_element_deprecated","Using `<slot>` to render parent content is deprecated. Use `{@render ...}` tags instead");
w(node,"slot_element_deprecated",`Using \`<slot>\` to render parent content is deprecated. Use \`{@render ...}\` tags instead\nhttps://svelte.dev/e/slot_element_deprecated`);
}
/**
@ -791,7 +791,7 @@ export function slot_element_deprecated(node) {
*@param{null|NodeLike}node
*/
exportfunctionsvelte_component_deprecated(node){
w(node,"svelte_component_deprecated","`<svelte:component>` is deprecated in runes mode — components are dynamic by default");
w(node,"svelte_component_deprecated",`\`<svelte:component>\` is deprecated in runes mode — components are dynamic by default\nhttps://svelte.dev/e/svelte_component_deprecated`);
}
/**
@ -799,7 +799,7 @@ export function svelte_component_deprecated(node) {
*@param{null|NodeLike}node
*/
exportfunctionsvelte_element_invalid_this(node){
w(node,"svelte_element_invalid_this","`this` should be an `{expression}`. Using a string attribute value will cause an error in future versions of Svelte");
w(node,"svelte_element_invalid_this",`\`this\` should be an \`{expression}\`. Using a string attribute value will cause an error in future versions of Svelte\nhttps://svelte.dev/e/svelte_element_invalid_this`);
}
/**
@ -809,5 +809,5 @@ export function svelte_element_invalid_this(node) {
w(node,"svelte_self_deprecated",`\`<svelte:self>\` is deprecated — use self-imports (e.g. \`import ${name} from './${basename}'\`) instead`);
w(node,"svelte_self_deprecated",`\`<svelte:self>\` is deprecated — use self-imports (e.g. \`import ${name} from './${basename}'\`) instead\nhttps://svelte.dev/e/svelte_self_deprecated`);
consterror=newError(`bind_invalid_checkbox_value\nUsing \`bind:value\` together with a checkbox input is not allowed. Use \`bind:checked\` instead`);
consterror=newError(`bind_invalid_checkbox_value\nUsing \`bind:value\` together with a checkbox input is not allowed. Use \`bind:checked\` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value`);
consterror=newError(`bind_invalid_export\nComponent ${component} has an export named \`${key}\` that a consumer component is trying to access using \`bind:${key}\`, which is disallowed. Instead, use \`bind:this\` (e.g. \`<${name} bind:this={component} />\`) and then access the property on the bound component instance (e.g. \`component.${key}\`)`);
consterror=newError(`bind_invalid_export\nComponent ${component} has an export named \`${key}\` that a consumer component is trying to access using \`bind:${key}\`, which is disallowed. Instead, use \`bind:this\` (e.g. \`<${name} bind:this={component} />\`) and then access the property on the bound component instance (e.g. \`component.${key}\`)\nhttps://svelte.dev/e/bind_invalid_export`);
consterror=newError(`bind_not_bindable\nA component is attempting to bind to a non-bindable property \`${key}\` belonging to ${component} (i.e. \`<${name} bind:${key}={...}>\`). To mark a property as bindable: \`let { ${key} = $bindable() } = $props()\``);
consterror=newError(`bind_not_bindable\nA component is attempting to bind to a non-bindable property \`${key}\` belonging to ${component} (i.e. \`<${name} bind:${key}={...}>\`). To mark a property as bindable: \`let { ${key} = $bindable() } = $props()\`\nhttps://svelte.dev/e/bind_not_bindable`);
consterror=newError(`component_api_changed\n${parent} called \`${method}\` on an instance of ${component}, which is no longer valid in Svelte 5. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information`);
consterror=newError(`component_api_changed\n${parent} called \`${method}\` on an instance of ${component}, which is no longer valid in Svelte 5. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information\nhttps://svelte.dev/e/component_api_changed`);
consterror=newError(`component_api_invalid_new\nAttempted to instantiate ${component} with \`new ${name}\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \`compatibility.componentApi\` compiler option to \`4\` to keep it working. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information`);
consterror=newError(`component_api_invalid_new\nAttempted to instantiate ${component} with \`new ${name}\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \`compatibility.componentApi\` compiler option to \`4\` to keep it working. See https://svelte.dev/docs/svelte/v5-migration-guide#Components-are-no-longer-classes for more information\nhttps://svelte.dev/e/component_api_invalid_new`);
@ -118,13 +112,12 @@ export function derived_references_self() {
*/
exportfunctioneach_key_duplicate(a,b,value){
if(DEV){
consterror=newError(`each_key_duplicate\n${value?`Keyed each block has duplicate key \`${value}\` at indexes ${a} and ${b}`:`Keyed each block has duplicate key at indexes ${a} and ${b}`}`);
consterror=newError(`each_key_duplicate\n${value?`Keyed each block has duplicate key \`${value}\` at indexes ${a} and ${b}`:`Keyed each block has duplicate key at indexes ${a} and ${b}`}\nhttps://svelte.dev/e/each_key_duplicate`);
@ -151,13 +143,12 @@ export function effect_in_teardown(rune) {
*/
exportfunctioneffect_in_unowned_derived(){
if(DEV){
consterror=newError(`effect_in_unowned_derived\nEffect cannot be created inside a \`$derived\` value that was not itself created inside an effect`);
consterror=newError(`effect_in_unowned_derived\nEffect cannot be created inside a \`$derived\` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived`);
@ -168,13 +159,12 @@ export function effect_in_unowned_derived() {
*/
exportfunctioneffect_orphan(rune){
if(DEV){
consterror=newError(`effect_orphan\n\`${rune}\` can only be used inside an effect (e.g. during component initialisation)`);
consterror=newError(`effect_orphan\n\`${rune}\` can only be used inside an effect (e.g. during component initialisation)\nhttps://svelte.dev/e/effect_orphan`);
@ -184,13 +174,12 @@ export function effect_orphan(rune) {
*/
exportfunctioneffect_update_depth_exceeded(){
if(DEV){
consterror=newError(`effect_update_depth_exceeded\nMaximum 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`);
consterror=newError(`effect_update_depth_exceeded\nMaximum 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\nhttps://svelte.dev/e/effect_update_depth_exceeded`);
@ -216,13 +204,12 @@ export function hydration_failed() {
*/
exportfunctioninvalid_snippet(){
if(DEV){
consterror=newError(`invalid_snippet\nCould not \`{@render}\` snippet due to the expression being \`null\` or \`undefined\`. Consider using optional chaining \`{@render snippet?.()}\``);
consterror=newError(`invalid_snippet\nCould not \`{@render}\` snippet due to the expression being \`null\` or \`undefined\`. Consider using optional chaining \`{@render snippet?.()}\`\nhttps://svelte.dev/e/invalid_snippet`);
@ -250,13 +236,12 @@ export function lifecycle_legacy_only(name) {
*/
exportfunctionprops_invalid_value(key){
if(DEV){
consterror=newError(`props_invalid_value\nCannot do \`bind:${key}={undefined}\` when \`${key}\` has a fallback value`);
consterror=newError(`props_invalid_value\nCannot do \`bind:${key}={undefined}\` when \`${key}\` has a fallback value\nhttps://svelte.dev/e/props_invalid_value`);
@ -267,13 +252,12 @@ export function props_invalid_value(key) {
*/
exportfunctionprops_rest_readonly(property){
if(DEV){
consterror=newError(`props_rest_readonly\nRest element properties of \`$props()\` such as \`${property}\` are readonly`);
consterror=newError(`props_rest_readonly\nRest element properties of \`$props()\` such as \`${property}\` are readonly\nhttps://svelte.dev/e/props_rest_readonly`);
@ -284,13 +268,12 @@ export function props_rest_readonly(property) {
*/
exportfunctionrune_outside_svelte(rune){
if(DEV){
consterror=newError(`rune_outside_svelte\nThe \`${rune}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files`);
consterror=newError(`rune_outside_svelte\nThe \`${rune}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files\nhttps://svelte.dev/e/rune_outside_svelte`);
@ -300,13 +283,12 @@ export function rune_outside_svelte(rune) {
*/
exportfunctionstate_descriptors_fixed(){
if(DEV){
consterror=newError(`state_descriptors_fixed\nProperty descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.`);
consterror=newError(`state_descriptors_fixed\nProperty descriptors defined on \`$state\` objects must contain \`value\` and always be \`enumerable\`, \`configurable\` and \`writable\`.\nhttps://svelte.dev/e/state_descriptors_fixed`);
@ -332,13 +313,12 @@ export function state_prototype_fixed() {
*/
exportfunctionstate_unsafe_local_read(){
if(DEV){
consterror=newError(`state_unsafe_local_read\nReading state that was created inside the same derived is forbidden. Consider using \`untrack\` to read locally created state`);
consterror=newError(`state_unsafe_local_read\nReading state that was created inside the same derived is forbidden. Consider using \`untrack\` to read locally created state\nhttps://svelte.dev/e/state_unsafe_local_read`);
@ -348,12 +328,11 @@ export function state_unsafe_local_read() {
*/
exportfunctionstate_unsafe_mutation(){
if(DEV){
consterror=newError(`state_unsafe_mutation\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\``);
consterror=newError(`state_unsafe_mutation\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without \`$state\`\nhttps://svelte.dev/e/state_unsafe_mutation`);
console.warn(`%c[svelte] assignment_value_stale\n%cAssignment to \`${property}\` property (${location}) will evaluate to the right-hand side, not the value of \`${property}\` following the assignment. This may result in unexpected behaviour.`,bold,normal);
console.warn(`%c[svelte] assignment_value_stale\n%cAssignment to \`${property}\` property (${location}) will evaluate to the right-hand side, not the value of \`${property}\` following the assignment. This may result in unexpected behaviour.\nhttps://svelte.dev/e/assignment_value_stale`,bold,normal);
console.warn(`%c[svelte] binding_property_non_reactive\n%c${location?`\`${binding}\` (${location}) is binding to a non-reactive property`:`\`${binding}\` is binding to a non-reactive property`}`,bold,normal);
console.warn(`%c[svelte] binding_property_non_reactive\n%c${location?`\`${binding}\` (${location}) is binding to a non-reactive property`:`\`${binding}\` is binding to a non-reactive property`}\nhttps://svelte.dev/e/binding_property_non_reactive`,bold,normal);
console.warn(`%c[svelte] event_handler_invalid\n%c${handler} should be a function. Did you mean to ${suggestion}?`,bold,normal);
console.warn(`%c[svelte] event_handler_invalid\n%c${handler} should be a function. Did you mean to ${suggestion}?\nhttps://svelte.dev/e/event_handler_invalid`,bold,normal);
console.warn(`%c[svelte] hydration_attribute_changed\n%cThe \`${attribute}\` attribute on \`${html}\` changed its value between server and client renders. The client value, \`${value}\`, will be ignored in favour of the server value`,bold,normal);
console.warn(`%c[svelte] hydration_attribute_changed\n%cThe \`${attribute}\` attribute on \`${html}\` changed its value between server and client renders. The client value, \`${value}\`, will be ignored in favour of the server value\nhttps://svelte.dev/e/hydration_attribute_changed`,bold,normal);
@ -81,10 +76,9 @@ export function hydration_attribute_changed(attribute, html, value) {
*/
exportfunctionhydration_html_changed(location){
if(DEV){
console.warn(`%c[svelte] hydration_html_changed\n%c${location?`The value of an \`{@html ...}\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}`,bold,normal);
console.warn(`%c[svelte] hydration_html_changed\n%c${location?`The value of an \`{@html ...}\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}\nhttps://svelte.dev/e/hydration_html_changed`,bold,normal);
@ -94,10 +88,9 @@ export function hydration_html_changed(location) {
*/
exportfunctionhydration_mismatch(location){
if(DEV){
console.warn(`%c[svelte] hydration_mismatch\n%c${location?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}`:"Hydration failed because the initial UI does not match what was rendered on the server"}`,bold,normal);
console.warn(`%c[svelte] hydration_mismatch\n%c${location?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}`:"Hydration failed because the initial UI does not match what was rendered on the server"}\nhttps://svelte.dev/e/hydration_mismatch`,bold,normal);
@ -106,10 +99,9 @@ export function hydration_mismatch(location) {
*/
exportfunctioninvalid_raw_snippet_render(){
if(DEV){
console.warn(`%c[svelte] invalid_raw_snippet_render\n%cThe \`render\` function passed to \`createRawSnippet\` should return HTML for a single element`,bold,normal);
console.warn(`%c[svelte] invalid_raw_snippet_render\n%cThe \`render\` function passed to \`createRawSnippet\` should return HTML for a single element\nhttps://svelte.dev/e/invalid_raw_snippet_render`,bold,normal);
console.warn(`%c[svelte] legacy_recursive_reactive_block\n%cDetected a migrated \`$:\` reactive block in \`${filename}\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \`$effect\`.`,bold,normal);
console.warn(`%c[svelte] legacy_recursive_reactive_block\n%cDetected a migrated \`$:\` reactive block in \`${filename}\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \`$effect\`.\nhttps://svelte.dev/e/legacy_recursive_reactive_block`,bold,normal);
@ -131,10 +122,9 @@ export function legacy_recursive_reactive_block(filename) {
*/
exportfunctionlifecycle_double_unmount(){
if(DEV){
console.warn(`%c[svelte] lifecycle_double_unmount\n%cTried to unmount a component that was not mounted`,bold,normal);
console.warn(`%c[svelte] lifecycle_double_unmount\n%cTried to unmount a component that was not mounted\nhttps://svelte.dev/e/lifecycle_double_unmount`,bold,normal);
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);
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}\nhttps://svelte.dev/e/ownership_invalid_binding`,bold,normal);
console.warn(`%c[svelte] ownership_invalid_mutation\n%c${component?`${component} mutated a value owned by ${owner}. This is strongly discouraged. Consider passing values to child components with \`bind:\`, or use a callback instead`:"Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead"}`,bold,normal);
console.warn(`%c[svelte] ownership_invalid_mutation\n%c${component?`${component} mutated a value owned by ${owner}. This is strongly discouraged. Consider passing values to child components with \`bind:\`, or use a callback instead`:"Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead"}\nhttps://svelte.dev/e/ownership_invalid_mutation`,bold,normal);
console.warn(`%c[svelte] reactive_declaration_non_reactive_property\n%cA \`$:\` statement (${location}) read reactive state that was not visible to the compiler. Updates to this state will not cause the statement to re-run. The behaviour of this code will change if you migrate it to runes mode`,bold,normal);
console.warn(`%c[svelte] reactive_declaration_non_reactive_property\n%cA \`$:\` statement (${location}) read reactive state that was not visible to the compiler. Updates to this state will not cause the statement to re-run. The behaviour of this code will change if you migrate it to runes mode\nhttps://svelte.dev/e/reactive_declaration_non_reactive_property`,bold,normal);
console.warn(`%c[svelte] state_proxy_equality_mismatch\n%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${operator}\` will produce unexpected results`,bold,normal);
console.warn(`%c[svelte] state_proxy_equality_mismatch\n%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${operator}\` will produce unexpected results\nhttps://svelte.dev/e/state_proxy_equality_mismatch`,bold,normal);
consterror=newError(`lifecycle_function_unavailable\n\`${name}(...)\` is not available on the server`);
consterror=newError(`lifecycle_function_unavailable\n\`${name}(...)\` is not available on the server\nhttps://svelte.dev/e/lifecycle_function_unavailable`);
'%c[svelte] state_snapshot_uncloneable\n%cValue cannot be cloned with `$state.snapshot` — the original value was returned'
'%c[svelte] state_snapshot_uncloneable\n%cValue cannot be cloned with `$state.snapshot` — the original value was returned\nhttps://svelte.dev/e/state_snapshot_uncloneable'
consterror=newError(`invalid_default_snippet\nCannot use \`{@render children(...)}\` if the parent component uses \`let:\` directives. Consider using a named snippet instead`);
consterror=newError(`invalid_default_snippet\nCannot use \`{@render children(...)}\` if the parent component uses \`let:\` directives. Consider using a named snippet instead\nhttps://svelte.dev/e/invalid_default_snippet`);
@ -25,13 +25,13 @@ export function invalid_default_snippet() {
*/
exportfunctionlifecycle_outside_component(name){
if(DEV){
consterror=newError(`lifecycle_outside_component\n\`${name}(...)\` can only be used during component initialisation`);
consterror=newError(`lifecycle_outside_component\n\`${name}(...)\` can only be used during component initialisation\nhttps://svelte.dev/e/lifecycle_outside_component`);
consterror=newError(`svelte_element_invalid_this_value\nThe \`this\` prop on \`<svelte:element>\` must be a string, if defined`);
consterror=newError(`svelte_element_invalid_this_value\nThe \`this\` prop on \`<svelte:element>\` must be a string, if defined\nhttps://svelte.dev/e/svelte_element_invalid_this_value`);
@ -11,10 +11,10 @@ var normal = 'font-weight: normal';
*/
exportfunctiondynamic_void_element_content(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);
console.warn(`%c[svelte] dynamic_void_element_content\n%c\`<svelte:element this="${tag}">\` is a void element — it cannot have content\nhttps://svelte.dev/e/dynamic_void_element_content`,bold,normal);