Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Diagnostics

Every diagnostic carries a stable code, the location and the line of code, and — when the fix is known — a fix: that vard check --fix applies. A short explanation: vard explain CODE; the full list with explanations: vard doc errors.

app.vard:2:14 error E0202: unknown prop `fontSize` on `Text`
  2 | Text("Hi", fontSize: 18)
  fix: `fontSize` -> `size` (auto: vard check --fix)

Classes

PrefixWhereExamples
E01xxsyntaxE0106 stray ;, E0110 a foreign keyword, E0111 an import, E0119 a modifier chain
E02xxnames, elements, props, packagesE0201 unknown element, E0202 unknown prop, E0203 unknown name, E0206 missing required argument
E03xxtypesE0301 type mismatch, E0304 unknown enum variant, E0314 optional not unwrapped, E0317 cannot cross the native boundary
E04xxmutabilityE0401 assignment to something immutable, E0402 in-place method on an immutable list
W04xxwarningsW0401 loop without by, W0403 Input without value
Rxxxxruntime (printed as ! R0003 … (file:line))R0003 state written during render, R0010 no native implementation
LxxxUI lintsL001 overflow, L002 small tap target, L005 contrast
Pxxxpackages and registries (location: a line of vard.toml)P001 no such package, P008 policy, P015 semver

Packages in the compiler (E023x)

CodeMeaningWhat to do
E0230a _ name is private to its packageuse the public API (vard doc PACKAGE)
E0231two direct dependencies export the namequalify it: charts.Badge(...)
E0232the name comes from a package that is not a direct dependencyvard add NAME
E0233two sides declare the same native nameremove the duplicate or rename it on both sides
E0234a name/parameter was renamed in a newer package versionvard check --fix
E0235pkg.Name: no such package or no such public namecheck the name; a typo comes with a fix:

Package manager (P0xx)

CodeMeaning
P001no package with this name; “did you mean” lists real names
P002the registry is unreachable or is not a Vard registry
P003no version satisfies the requirement
P004integrity failure: the archive hash differs, or the version is not in the signed log
P005the registry key changed or the log history was rewritten
P006incompatible requirements for one package (different major lines)
P007the package needs a different vard core version
P008a sensitive capability is not approved in [policy]
P009the version was yanked
P010an invalid, reserved or too-similar-to-someone-else’s name
P011no AGENT.md, or it exceeds the 6 KB budget
P012the package does not compile
P013declared capabilities differ from the computed ones
P014the package’s tests failed
P015the version number does not match the API change
P016the version is already published or is not newer than the latest on its line
P017[sim] refers to an undeclared extern
P018no token, or not the owner’s token
P019the archive is larger than 8 MB
P020vard.toml is not valid TOML (the subset Vard uses)
P021a wrong or unknown field in vard.toml
P022the project’s packages are missing or out of date
P023a minor/patch release fails the previous version’s tests (behavior changed)
P024the package is new (first published < 72 h ago): a person confirms with --allow-new
P025a git dependency could not be fetched, or its tag/rev/branch does not exist

Rules for new diagnostics (for framework developers)

A new code is stable, has an entry in explain.rs (compiler), vard_runtime::EXPLAIN (runtime, lints) or vard_pkg::EXPLAIN (packages), and a fix whenever the correct edit is known. When the fix is obvious, checking continues as if it were already applied — one iteration instead of several, no avalanche of follow-up errors.