You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/documentation/docs/98-reference/30-runtime-errors.md

111 lines
3.9 KiB

---
title: 'Runtime errors'
generated: 'generated by process-messages/index.js'
---
## `bind_invalid_checkbox_value`
> [!NOTE] Using 'bind:value' together with a checkbox input is not allowed. Use 'bind:checked' instead
## `bind_invalid_export`
> [!NOTE] Component %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%')
## `bind_not_bindable`
> [!NOTE] A 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()'
## `component_api_changed`
> [!NOTE] %parent% called '%method%' on an instance of %component%, which is no longer valid in Svelte 5. See https://svelte-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information
## `component_api_invalid_new`
> [!NOTE] Attempted 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-5-preview.vercel.app/docs/breaking-changes#components-are-no-longer-classes for more information
## `derived_references_self`
> [!NOTE] A derived value cannot reference itself recursively
## `each_key_duplicate`
> [!NOTE] Keyed each block has duplicate key at indexes %a% and %b%
> [!NOTE] Keyed each block has duplicate key '%value%' at indexes %a% and %b%
## `effect_in_teardown`
> [!NOTE] '%rune%' cannot be used inside an effect cleanup function
## `effect_in_unowned_derived`
> [!NOTE] Effect cannot be created inside a '$derived' value that was not itself created inside an effect
## `effect_orphan`
> [!NOTE] '%rune%' can only be used inside an effect (e.g. during component initialisation)
## `effect_update_depth_exceeded`
> [!NOTE] 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
## `hydration_failed`
> [!NOTE] Failed to hydrate the application
## `invalid_default_snippet`
> [!NOTE] Cannot use '{@render children(...)}' if the parent component uses 'let:' directives. Consider using a named snippet instead
## `invalid_snippet`
> [!NOTE] Could not '{@render}' snippet due to the expression being 'null' or 'undefined'. Consider using optional chaining '{@render snippet?.()}'
## `lifecycle_function_unavailable`
> [!NOTE] '%name%(...)' is not available on the server
## `lifecycle_legacy_only`
> [!NOTE] '%name%(...)' cannot be used in runes mode
## `lifecycle_outside_component`
> [!NOTE] '%name%(...)' can only be used during component initialisation
## `props_invalid_value`
> [!NOTE] Cannot do 'bind:%key%={undefined}' when '%key%' has a fallback value
## `props_rest_readonly`
> [!NOTE] Rest element properties of '$props()' such as '%property%' are readonly
## `rune_outside_svelte`
> [!NOTE] The '%rune%' rune is only available inside '.svelte' and '.svelte.js/ts' files
## `state_descriptors_fixed`
> [!NOTE] Property descriptors defined on '$state' objects must contain 'value' and always be 'enumerable', 'configurable' and 'writable'.
## `state_prototype_fixed`
> [!NOTE] Cannot set prototype of '$state' object
## `state_unsafe_local_read`
> [!NOTE] Reading state that was created inside the same derived is forbidden. Consider using 'untrack' to read locally created state
## `state_unsafe_mutation`
> [!NOTE] Updating state inside a derived is forbidden. If the value should not be reactive, declare it without '$state'
## `store_invalid_shape`
> [!NOTE] '%name%' is not a store with a 'subscribe' method
## `svelte_element_invalid_this_value`
> [!NOTE] The 'this' prop on '\<svelte:element>' must be a string, if defined