Duolith docs

Errors while checking a page

E0109 Assignment to a derived value

Message name is a derived value and cannot be assigned

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

Why

A derived value is computed from other values and recomputed whenever they change, so anything assigned to it would be lost. A derived value a behaviour returns is read-only however it is reached (decision 0152): unpacked by name, read from the result (cal.double, cal["double"]), through another name for the result, or through a parameter typed as the result, which TypeScript reports as a read-only property (TS2540).

How to fix it

Assign to the state it is computed from, or declare it with state(...) instead.

In a terminal

duolith explain E0109

Mentioned in