T13
Error
Types
T13 — A name nothing declares
A name, or a function called, that no declaration, parameter, script or browser global provides — a ReferenceError the first time the page reads it.
What the compiler said
error[T13]: nothing declares `cuont` --> src/App.wf:4:30 | 4 | Button("+") { on click { cuont = count + 1 } } | ^^^^^ = help: Did you mean `count`? Declare it — a `state`, a `const`, an `action`, a prop — or check the spelling. In the browser it would be a ReferenceError = docs: https://webfluent.monzeromer.dev/errors/T13
Your editor offers this fix: Change to count. wf fix --code T13 applies it to every place it fits.
The fix
Broken
page P(path: "/", title: "T", description: "D") {
state count = 0
Heading("Counter").h1
Button("+") { on click { cuont = count + 1 } }
}
Fixed
page P(path: "/", title: "T", description: "D") {
state count = 0
Heading("Counter").h1
Button("+") { on click { count = count + 1 } }
}
Correct the spelling, or declare the name. The browser's own
globals (window, navigator, Math …) and the language's values
(viewport, query, now …) need no declaration; a call to a function
nothing declares — uid() for uuid() — is reported the same way. A
template rendered with data (wf render) reads its data's keys by name, so
it is not held to this.
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.