R03
Error
Routes
R03 — An app with no Router, or with two
The current page is drawn where app places its Router. With none, no page is ever drawn; with two, the page has two places.
What the compiler said
error[R03]: `app` places no `Router`, so no page is ever drawn --> src/App.wf:2:5 | 2 | Navbar { Navbar.Brand { Text("Ledger") } } | ^^^^^^ = help: Put `Router` where the current page belongs: `app { Navbar { … } Router }` = docs: https://webfluent.monzeromer.dev/errors/R03
Your editor offers this fix: Add Router. wf fix --code R03 applies it to every place it fits.
The fix
Broken
app {
Navbar { Navbar.Brand { Text("Ledger") } }
}
page Home(path: "/", title: "T", description: "D") {
Heading("Home").h1
}
Fixed
app {
Navbar { Navbar.Brand { Text("Ledger") } }
Router
}
page Home(path: "/", title: "T", description: "D") {
Heading("Home").h1
}
Place Router where the page belongs: app { Navbar { … }
Router }. (A program with no app at all routes its pages by itself.)
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.