What this error means
ERC walks every item on every sheet and looks at fields whose canonical name
is Netclass — the built-in field on a netclass directive label, or a field
on an ordinary label (the GUI displays it as "Net Class"; both spellings
resolve to the same field). For each one it resolves text variables, then
flags the field if its text is non-empty, is not the default class name, and
does not match any class defined in the project's net class table. The match
is a plain lookup, so it is case-sensitive: a directive saying HV is not
satisfied by a class named hv.
Net classes live in the project file (.kicad_pro), not in the schematic.
That has two consequences. First, the check fires even if the directive is
electrically connected and the schematic is otherwise clean — connectivity
is never consulted. Second, running ERC on a .kicad_sch that has lost its
.kicad_pro flags every graphical net class assignment in the design,
because as far as ERC can tell none of those classes exist.
The check exists because KiCad does not error out on an unknown class name
at assignment time: the net quietly resolves to Default, with Default's
track width, clearance, and colors. The schematic looks like a custom class
is applied when it isn't, which is why the feature request that introduced
this check in KiCad 8 called for ERC to catch exactly that.
Common causes
1. The class name doesn't match any defined net class
A typo in the directive's Netclass field, a class that was renamed or
deleted in Schematic Setup after directives were placed, or a plain
case mismatch (hv defined, HV referenced — the comparison is
case-sensitive). The assignment silently falls back to Default, so the
board can pass DRC with the wrong track widths; this error is the only
warning you get.
2. ERC ran without the project file
Net classes are stored in .kicad_pro. Opening a bare .kicad_sch
standalone, or pointing kicad-cli sch erc at a schematic in a
checkout that doesn't include the project file, makes every netclass
directive in the design report this error at once. A wall of
undefined-netclass errors on a design that was clean yesterday almost
always means the project file wasn't loaded.
3. An empty Netclass field on KiCad 8.0 through 9.0.3
Those releases flagged labels whose Netclass field existed but was blank — typically left behind by the Assign Netclass dialog. The message prints a blank where the class name belongs, which made the reports baffling on nets whose class was defined. 9.0.4 added the empty-field guard; 10.0 has it from the start.
How to fix it
Define the class in Schematic Setup
- Open File → Schematic Setup… → Project → Net Classes.
- Add a class with the + button and name it exactly as the directive spells it, including case.
- Re-run ERC (Inspect → Electrical Rules Checker).
Use when: The assignment is intentional and the class was never defined (or was renamed). The class needs no custom settings to satisfy the check; an entry in the table is enough.
Fix the name on the label
- Double-click the directive label (or the label carrying the Net Class field).
- Pick the intended class from the field's dropdown — it lists every class defined in Schematic Setup, so choosing from it can't misspell.
- Re-run ERC.
Use when: The class exists and the field has a typo or stale name. On versions before 9.0.4, also use this to delete an empty Net Class field the Assign Netclass dialog left behind, or upgrade.
Run ERC with the project file present
- Keep the .kicad_pro next to the .kicad_sch, with the same base name.
- In scripts and CI, run kicad-cli against a checkout that includes the .kicad_pro, not a lone schematic file.
- Re-run kicad-cli sch erc and confirm the errors disappear.
Use when: The design is clean in the schematic editor but a CLI run or a standalone open reports this error for every directive in the design.
When it’s safe to exclude
Rarely — but there is one honest case. KiCad lets you use "implicit" net classes: a name typed into a directive that is never defined in Schematic Setup, carrying no design settings, existing only to be matched by custom DRC rules on the board side. The docs endorse the pattern and this check flags it anyway. Even then, adding an empty class definition in the table costs one row and keeps the check alive for real typos, so prefer that over excluding.
Excluding individual markers (right-click the marker → Exclude) or downgrading the severity in Schematic Setup → Electrical Rules → Violation Severity hides the failure mode this check was created for: a misspelled class silently resolves to Default, the schematic looks right, and the board routes with Default's widths and clearances. Nothing else warns you about that.
Gotchas
- The fallback is silent everywhere but here. A wire under a directive
naming an unknown class draws and routes as
Default— same width, same color — so the schematic gives no visual hint. Select the wire and read the resolved net class in the message panel at the bottom of the window. - The check never looks at connectivity. A netclass directive floating in empty space still reports its undefined class (plus a dangling-label violation for not touching anything).
- Net classes are shared project-wide: defining the class in Board Setup's Net Classes table satisfies the schematic check too, because both edit the same table in the project file.
Version notes
- KiCad 8.0: Check introduced in this release.
- KiCad 9.0.4: Stopped flagging labels whose Netclass field is present but empty; 8.0 through 9.0.3 reported those too (commonly left behind by the Assign Netclass dialog).
Minimal reproduction
Place a netclass directive label (Place → Place Directive Labels) on any
wire, set its Netclass field to a name you never defined — say HV — and
run ERC without defining the class in Schematic Setup. The directive
reports:
[undefined_netclass]: Netclass HV is not defined
; error
@(116.84 mm, 101.60 mm): Directive Label [Net Class HV]
The checked-in file data/erc/samples/undefined_netclass.kicad_sch
reproduces this with a directive labeled HV on a wire between two
embedded one-pin symbols; because the file embeds its own symbols, ERC
also emits two lib_symbol_issues warnings about the missing repro
library — artifacts of the self-contained repro, not part of this error.
Adding a sibling .kicad_pro that defines a class named HV drops the
error, which is fix #1 in miniature; renaming that class to hv brings
the error back, which is the case-sensitivity trap in cause #1.
Related errors
FAQ
Why does ERC say 'Netclass not defined' on only one line of my differential pair?
On KiCad 8.0 through 9.0.3 this was usually the empty-field bug: the Assign Netclass dialog could leave a blank Netclass field on one label, and ERC flagged the blank even though the pair's class was defined. Upgrade to 9.0.4 or later, or open the flagged label and delete the empty Net Class field.
I use a directive label only for a component class — why does ERC complain about its net class?
Directive labels carry both a Netclass and a Component Class field, and ERC checks the Netclass field whenever it contains text. Delete the unused Netclass field from the directive's properties, or leave it empty (empty fields pass on KiCad 9.0.4 and later).
I typed a net class on a directive but the wire still uses Default track width — why?
An unknown class name doesn't error at assignment time; the net quietly resolves to the Default class and takes Default's width, clearance, and colors. That silent fallback is the reason this ERC check exists. Define the class in Schematic Setup → Project → Net Classes and the directive starts working.