Duolith docs

Errors while checking a page

E0173 Behaviour result the build cannot read

Message name must end with one return { ... } of its own names, so the build knows what each one is

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 behaviour returns one object with a name for each value it gives its caller, and the build compiles each name by what it is: a state is read each time and may be assigned, a derived value is read each time and never assigned, and anything else, such as a function, is passed as it is (decision 0152). It can only know that when the behaviour's body ends with one return { ... } that names values declared in that body, such as return { month, weeks, move } or return { month: shown }. A return in the middle of the body, a spread, a computed or getter property, or a value written in place (return { min: input.min }) leaves it unknown. A behaviour that only runs effects may return nothing.

How to fix it

Declare each value in the behaviour's body (let weeks = derived(...), function move() { ... }) and end the body with return { weeks, move }.

In a terminal

duolith explain E0173

Mentioned in