Duolith docs

Errors while checking a page

E0108 Two-way binding to something other than state

Message attribute needs a state variable, and problem

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

bind:value and bind:checked write what the user enters back into the variable, so the variable must be one the page owns, declared with state(...). Derived values, list items and other expressions cannot be written, and neither can a prop unless the component declares it with a bindable(...) default. On a placed component, bind:name works only for such a bindable prop.

How to fix it

Bind to a variable declared with let name = state(...), or use value={...} with an on:input handler.

In a terminal

duolith explain E0108

Mentioned in