T06
Error
Types
T06 — A member a store or service does not have
A store's state, derived value or action, or a service's endpoint, that it does not declare.
What the compiler said
error[T06]: `Cart` has no member `count` --> src/App.wf:4:20 | 4 | Heading("{Cart.count} items").h1 | ^^^^^ = help: Its members are `items` = docs: https://webfluent.monzeromer.dev/errors/T06
The fix
Broken
store Cart { state items: [String] = [] }
page P(path: "/", title: "T", description: "D") {
use Cart
Heading("{Cart.count} items").h1
}
Fixed
store Cart {
state items: [String] = []
derived count = items.length
}
page P(path: "/", title: "T", description: "D") {
use Cart
Heading("{Cart.count} items").h1
}
Use a member the store declares, or declare it: derived count = items.length. For a service, the endpoint must be declared in its api.
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.