E105

Error

Syntax and structure

E105 — A statement a render block cannot hold

A page's or component's body draws; an assignment or a call that does something belongs in a handler, an action or an effect.

What the compiler said

error[E105]: `n` is not an element or a statement a render block can hold --> src/App.wf:4:5 | 4 | n = n + 1 | ^ = help: Code that does something goes in `on click { … }`, an `action` or an `effect`; an element's name is capitalised = docs: https://webfluent.monzeromer.dev/errors/E105

The fix

Broken

wf

page P(path: "/", title: "T", description: "D") { state n = 0 Heading("Count").h1 n = n + 1 }

Fixed

wf

page P(path: "/", title: "T", description: "D") { state n = 0 Heading("Count {n}").h1 Button("+1") { on click { n = n + 1 } } }

Put it in on click { }, an action or an effect.

Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).

lints cannot lower it: it would ship a broken page.