S04

Error

Search and sharing

S04 — Two pages on one route

Two pages claim one path, and only one of them can ever be reached.

What the compiler said

error[S04]: Pages A and B both claim the route /about --> src/App.wf:2:1 | 2 | page B(path: "/about", title: "B", description: "D") { Heading("B").h1 } | ^^^^ = help: Give each page its own path = docs: https://webfluent.monzeromer.dev/errors/S04

The fix

Broken

wf

page A(path: "/about", title: "A", description: "D") { Heading("A").h1 } page B(path: "/about", title: "B", description: "D") { Heading("B").h1 }

Fixed

wf

page A(path: "/about", title: "A", description: "D") { Heading("A").h1 } page B(path: "/team", title: "B", description: "D") { Heading("B").h1 }

Give each page its own path:. Only one of them would ever render.

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 may lower it:

"lints": { "S04": "warn" } // wf-allow(S04)