docs: tweak "invalid assignment" compiler error message
#14955In runes mode, when iterating an array of objects in an each loop, it is not possible to bind the object to a component.
<svelte:options runes={true} />
<script>
import Component from "./Component.svelte"
let objs = [{
val: "foo"
}]
</script>
{#each objs as obj}
<Component bind:obj />
{/each}
Error each_item_invalid_assignment
is raised. This works fine when runes mode is disabled.
https://svelte.dev/playground/71e6da2a2afd4a5e812bdd7263e5c7dd?version=5.12.0
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`)
https://svelte.dev/e/each_item_invalid_assignment
svelte 5.12.0, see repl
blocking an upgrade
fixes #14702
Latest commit: cc960d3
The changes in this PR will be included in the next version bump.
Name | Type |
---|---|
svelte | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
preview: https://svelte-dev-git-preview-svelte-14955-svelte.vercel.app/
this is an automated message
pnpm add https://pkg.pr.new/svelte@14955
fixes #14702