`$:` is not allowed in runes mode, use `$derived` or `$effect` instead
## invalid_legacy_export
Cannot use `export let` in runes mode — use $props instead
## invalid_rune_usage
Cannot use %rune% rune in non-runes mode
## invalid_state_export
Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties
## invalid_derived_export
Cannot export derived state from a module. To expose the current derived value, export a function returning its value
## invalid_props_id
`$props()` can only be used with an object destructuring pattern
## invalid_props_pattern
`$props()` assignment must not contain nested properties or computed keys
## invalid_props_location
`$props()` can only be used at the top level of components as a variable declaration initializer
## invalid_bindable_location
`$bindable()` can only be used inside a `$props()` declaration
## invalid_state_location
`%rune%(...)` can only be used as a variable declaration initializer or a class field
## invalid_effect_location
`$effect()` can only be used as an expression statement
## invalid_host_location
`$host()` can only be used inside custom element component instances
## invalid_assignment
Cannot assign to %thing%
## invalid_binding
Cannot bind to %thing%
## invalid_rune_args
`%rune%` cannot be called with arguments
## invalid_rune_args_length
`%rune%` must be called with %args%
## invalid_runes_mode_import
%name% cannot be used in runes mode
## duplicate_props_rune
Cannot use `$props()` more than once
## invalid_each_assignment
Cannot reassign or bind to each block argument in runes mode. Use the array and index variables instead (e.g. `array[i] = value` instead of `entry = value`)
## invalid_snippet_assignment
Cannot reassign or bind to snippet parameter
## invalid_derived_call
`$derived.call(...)` has been replaced with `$derived.by(...)`
## conflicting_property_name
Cannot have a property and a component export with the same name
`<slot>` can only receive attributes and (optionally) let directives
## invalid_slot_attribute
slot attribute must be a static value
## invalid_slot_name_default
`default` is a reserved word — it cannot be used as a slot name
## invalid_slot_name
slot attribute must be a static value
## invalid_slot_placement
Element with a slot='...' attribute must be a child of a component or a descendant of a custom element
## duplicate_slot_name
Duplicate slot name '%name%' in <%component%>
## invalid_default_slot_content
Found default slot content alongside an explicit slot="default"
## conflicting_children_snippet
Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block
`<svelte:options>` can only receive static attributes
## invalid_svelte_option_namespace
Unsupported `<svelte:option>` value for "namespace". Valid values are "html", "svg" or "foreign"
## tag_option_deprecated
"tag" option is deprecated — use "customElement" instead
## invalid_svelte_option_runes
Unsupported `<svelte:option>` value for "runes". Valid values are true or false
## invalid_svelte_option_accessors
Unsupported `<svelte:option>` value for "accessors". Valid values are true or false
## invalid_svelte_option_preserveWhitespace
Unsupported `<svelte:option>` value for "preserveWhitespace". Valid values are true or false
## invalid_svelte_option_immutable
Unsupported `<svelte:option>` value for "immutable". Valid values are true or false
## invalid_tag_property
Tag name must be two or more words joined by the "-" character
## invalid_svelte_option_customElement
"customElement" must be a string literal defining a valid custom element name or an object of the form { tag: string; shadow?: "open" | "none"; props?: { [key: string]: { attribute?: string; reflect?: boolean; type: .. } } }
## invalid_customElement_props_attribute
"props" must be a statically analyzable object literal of the form "{ [key: string]: { attribute?: string; reflect?: boolean; type?: "String" | "Boolean" | "Number" | "Array" | "Object" }"
## invalid_customElement_shadow_attribute
"shadow" must be either "open" or "none"
## unknown_svelte_option_attribute
`<svelte:options>` unknown attribute '%name%'
## illegal_svelte_head_attribute
`<svelte:head>` cannot have attributes nor directives
## invalid_svelte_fragment_attribute
`<svelte:fragment>` can only have a slot attribute and (optionally) a let: directive
## invalid_svelte_fragment_slot
`<svelte:fragment>` slot attribute must have a static value
## invalid_svelte_fragment_placement
`<svelte:fragment>` must be the direct child of a component
## invalid_svelte_element_placement
<%name%> tags cannot be inside elements or blocks
## duplicate_svelte_element
A component can only have one <%name%> element
## invalid_self_placement
`<svelte:self>` components can only exist inside {#if} blocks, {#each} blocks, {#snippet} blocks or slots passed to components
## missing_svelte_element_definition
`<svelte:element>` must have a 'this' attribute
## missing_svelte_component_definition
`<svelte:component>` must have a 'this' attribute
## invalid_svelte_element_definition
Invalid element definition — must be an {expression}
## invalid_svelte_component_definition
Invalid component definition — must be an {expression}
## invalid_svelte_tag
Valid `<svelte:...>` tag names are %list%
## conflicting_slot_usage
Cannot use `<slot>` syntax and `{@render ...}` tags in the same component. Migrate towards `{@render ...}` tags completely.
Non-interactive element <%element%> cannot have interactive role '%role%'
## a11y_accesskey
Avoid using accesskey
## a11y_autofocus
Avoid using autofocus
## a11y_misplaced_scope
The scope attribute should only be used with <th> elements
## a11y_positive_tabindex
Avoid tabindex values above zero
## 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 <buttontype="button"> or <a> might be more appropriate. See https://svelte.dev/docs/accessibility-warnings#a11y-click-events-have-key-events for more details.
## a11y_no_noninteractive_tabindex
noninteractive element cannot have nonnegative tabIndex value
## a11y_role_supports_aria_props
The attribute '%attribute%' is not supported by the role '%role%'
## a11y_role_supports_aria_props_implicit
The attribute '%attribute%' is not supported by the role '%role%'. This role is implicit on the element <%name%>
## a11y_no_noninteractive_element_interactions
Non-interactive element <%element%> should not be assigned mouse or keyboard event listeners.
## a11y_no_static_element_interactions
<%element%> with a %handler% handler must have an ARIA role
## a11y_invalid_attribute
'%href_value%' is not a valid %href_attribute% attribute
## a11y_missing_attribute
<%name%> element should have %article% %sequence% attribute
## a11y_autocomplete_valid
The value '%value%' is not supported by the attribute 'autocomplete' on element <inputtype="%type%">
## a11y_img_redundant_alt
Screenreaders already announce <img> elements as an image.
## a11y_label_has_associated_control
A form label must be associated with a control.
## a11y_media_has_caption
<video> elements must have a <trackkind="captions">
## a11y_distracting_elements
Avoid <%name%> elements
## a11y_figcaption_parent
`<figcaption>` must be an immediate child of `<figure>`
## a11y_figcaption_index
`<figcaption>` must be first or last child of `<figure>`
## a11y_mouse_events_have_key_events
'%event%' event must be accompanied by '%accompanied_by%' event
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
## non_state_reference
`%name%` is updated, but is not declared with `$state(...)`. Changing its value will not correctly trigger updates
## derived_iife
Use `$derived.by(() => {...})` instead of `$derived((() => {...})())`
## invalid_props_declaration
Component properties are declared using `$props()` in runes mode. Did you forget to call the function?
## invalid_bindable_declaration
Bindable component properties are declared using `$bindable()` in runes mode. Did you forget to call the function?
'invalid-customElement-shadow-attribute':()=>'"shadow" must be either "open" or "none"',
'unknown-svelte-option-attribute':/** @param {string} name */(name)=>
`<svelte:options> unknown attribute '${name}'`,
'illegal-svelte-head-attribute':()=>'<svelte:head> cannot have attributes nor directives',
'invalid-svelte-fragment-attribute':()=>
`<svelte:fragment> can only have a slot attribute and (optionally) a let: directive`,
'invalid-svelte-fragment-slot':()=>`<svelte:fragment> slot attribute must have a static value`,
'invalid-svelte-fragment-placement':()=>
`<svelte:fragment> must be the direct child of a component`,
/** @param {string} name */
'invalid-svelte-element-placement':(name)=>
`<${name}> tags cannot be inside elements or blocks`,
/** @param {string} name */
'duplicate-svelte-element':(name)=>`A component can only have one <${name}> element`,
'invalid-self-placement':()=>
`<svelte:self> components can only exist inside {#if} blocks, {#each} blocks, {#snippet} blocks or slots passed to components`,
'missing-svelte-element-definition':()=>`<svelte:element> must have a 'this' attribute`,
'missing-svelte-component-definition':()=>`<svelte:component> must have a 'this' attribute`,
'invalid-svelte-element-definition':()=>`Invalid element definition — must be an {expression}`,
'invalid-svelte-component-definition':()=>
`Invalid component definition — must be an {expression}`,
/**
*@param{string[]}tags
*@param{string|null}match
*/
'invalid-svelte-tag':(tags,match)=>
`Valid <svelte:...> tag names are ${list(tags)}${match?' (did you mean '+match+'?)':''}`,
'conflicting-slot-usage':()=>
`Cannot use <slot> syntax and {@render ...} tags in the same component. Migrate towards {@render ...} tags completely.`
};
/** @satisfies {Errors} */
construnes={
'invalid-legacy-props':()=>`Cannot use $$props in runes mode`,
'invalid-legacy-rest-props':()=>`Cannot use $$restProps in runes mode`,
'invalid-legacy-reactive-statement':()=>
`$: is not allowed in runes mode, use $derived or $effect instead`,
'invalid-legacy-export':()=>`Cannot use \`export let\` in runes mode — use $props instead`,
/** @param {string} rune */
'invalid-rune-usage':(rune)=>`Cannot use ${rune} rune in non-runes mode`,
'invalid-state-export':()=>
`Cannot export state from a module if it is reassigned. Either export a function returning the state value or only mutate the state value's properties`,
'invalid-derived-export':()=>
`Cannot export derived state from a module. To expose the current derived value, export a function returning its value`,
'invalid-props-id':()=>`$props() can only be used with an object destructuring pattern`,
'invalid-props-pattern':()=>
`$props() assignment must not contain nested properties or computed keys`,
'invalid-props-location':()=>
`$props() can only be used at the top level of components as a variable declaration initializer`,
'invalid-bindable-location':()=>`$bindable() can only be used inside a $props() declaration`,
/** @param {string} rune */
'invalid-state-location':(rune)=>
`${rune}(...) can only be used as a variable declaration initializer or a class field`,
'invalid-effect-location':()=>`$effect() can only be used as an expression statement`,
'invalid-host-location':()=>
`$host() can only be used inside custom element component instances`,
'invalid-runes-mode-import':(name)=>`${name} cannot be used in runes mode`,
'duplicate-props-rune':()=>`Cannot use $props() more than once`,
'invalid-each-assignment':()=>
`Cannot reassign or bind to each block argument in runes mode. Use the array and index variables instead (e.g. 'array[i] = value' instead of 'entry = value')`,
'invalid-snippet-assignment':()=>`Cannot reassign or bind to snippet parameter`,
'invalid-derived-call':()=>`$derived.call(...) has been replaced with $derived.by(...)`,
'conflicting-property-name':()=>
`Cannot have a property and a component export with the same name`
};
/** @satisfies {Errors} */
constelements={
'invalid-textarea-content':()=>
`A <textarea> can have either a value attribute or (equivalently) child content, but not both`,
'invalid-void-content':()=>`Void elements cannot have children or closing tags`,
/** @param {string} name */
'invalid-element-content':(name)=>`<${name}> cannot have children`,
'invalid-tag-name':()=>'Expected valid tag name',
/**
*@param{string}node
*@param{string}parent
*/
'invalid-node-placement':(node,parent)=>`${node} is invalid inside <${parent}>`,
'illegal-title-attribute':()=>'<title> cannot have attributes nor directives',
'invalid-title-content':()=>'<title> can only contain text and {tags}'
};
/** @satisfies {Errors} */
constcomponents={
'invalid-component-directive':()=>`This type of directive is not valid on components`
};
/** @satisfies {Errors} */
constattributes={
'empty-attribute-shorthand':()=>`Attribute shorthand cannot be empty`,
'duplicate-attribute':()=>`Attributes need to be unique`,
'invalid-event-attribute-value':()=>
`Event attribute must be a JavaScript expression, not a string`,
/** @param {string} name */
'invalid-attribute-name':(name)=>`'${name}' is not a valid attribute name`,
/** @param {'no-each' | 'each-key' | 'child'} type */
'invalid-animation':(type)=>
type==='no-each'
?`An element that uses the animate directive must be the immediate child of a keyed each block`
:type==='each-key'
?`An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?`
:`An element that uses the animate directive must be the sole child of a keyed each block`,
'duplicate-animation':()=>`An element can only have one 'animate' directive`,
/** @param {string[] | undefined} [modifiers] */
'invalid-event-modifier':(modifiers)=>
modifiers
?`Valid event modifiers are ${modifiers.slice(0,-1).join(', ')} or ${modifiers.slice(-1)}`
:`Event modifiers other than 'once' can only be used on DOM elements`,
`Sequence expressions are not allowed as attribute/directive values in runes mode, unless wrapped in parentheses`
};
/** @satisfies {Errors} */
constslots={
'invalid-slot-element-attribute':()=>
`<slot> can only receive attributes and (optionally) let directives`,
'invalid-slot-attribute':()=>`slot attribute must be a static value`,
/** @param {boolean} is_default */
'invalid-slot-name':(is_default)=>
is_default
?`default is a reserved word — it cannot be used as a slot name`
:`slot attribute must be a static value`,
'invalid-slot-placement':()=>
`Element with a slot='...' attribute must be a child of a component or a descendant of a custom element`,
/** @param {string} name @param {string} component */
'duplicate-slot-name':(name,component)=>`Duplicate slot name '${name}' in <${component}>`,
'invalid-default-slot-content':()=>
`Found default slot content alongside an explicit slot="default"`,
'conflicting-children-snippet':()=>
`Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block`
};
/** @satisfies {Errors} */
constbindings={
'invalid-binding-expression':()=>`Can only bind to an Identifier or MemberExpression`,
'invalid-binding-value':()=>`Can only bind to state or props`,
/**
*@param{string}binding
*@param{string}[elements]
*@param{string}[post]
*/
'invalid-binding':(binding,elements,post='')=>
(elements
?`'${binding}' binding can only be used with ${elements}`
:`'${binding}' is not a valid binding`)+post,
'invalid-type-attribute':()=>
`'type' attribute must be a static text value if input uses two-way binding`,
'invalid-multiple-attribute':()=>
`'multiple' attribute must be static if select uses two-way binding`,
'missing-contenteditable-attribute':()=>
`'contenteditable' attribute is required for textContent, innerHTML and innerText two-way bindings`,
'dynamic-contenteditable-attribute':()=>
`'contenteditable' attribute cannot be dynamic if element uses two-way binding`
};
/** @satisfies {Errors} */
constvariables={
'illegal-global':/** @param {string} name */(name)=>
`${name} is an illegal variable name. To reference a global variable called ${name}, use globalThis.${name}`,
/** @param {string} name */
'duplicate-declaration':(name)=>`'${name}' has already been declared`,
'default-export':()=>`A component cannot have a default export`,
'illegal-variable-declaration':()=>
'Cannot declare same variable name which is imported inside <script context="module">',
'illegal-store-subscription':()=>
'Cannot subscribe to stores that are not declared at the top level of the component'
'A11y: 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.',
'a11y-no-noninteractive-tabindex':()=>
'A11y: noninteractive element cannot have nonnegative tabIndex value',
// Utility type for ensuring backwards compatibility on a type level: If there's a default slot, add 'children' to the props if it doesn't exist there already
/** Tooling for types uses this for properties are being used with `bind:` */
`Component ${component.filename} 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}).`
);
}
if(!bindable.includes(key)){
thrownewError(
thrownewError(
`Cannot use bind:${key} on this component because the property was not declared as bindable. `+
`A component is binding to property ${key} of ${name}.svelte (i.e. <${name} bind:${key} />). This is disallowed because the property was not declared as bindable inside ${component.filename}. `+
`To mark a property as bindable, use the $bindable() rune like this: \`let { ${key} = $bindable() } = $props()\``
`To mark a property as bindable, use the $bindable() rune in ${name}.svelte like this: \`let { ${key} = $bindable() } = $props()\``