What this error means
For every symbol on every sheet, ERC takes each field's name, trims leading and trailing whitespace, and compares the result to the original. Any difference raises one warning per offending field, anchored at that field. Hierarchical sheet fields go through the same loop, so a user field on a sheet can trip it too.
Only the name is tested. Field values can hold all the whitespace they
want: a datasheet URL with %20s, a three-word description, none of that
matters here. What the check objects to is MPN as a field name,
because to KiCad that is a different field than MPN. The two don't
match in the Symbol Fields Table, in BOM exports, or against the field
name templates in Preferences, and since the space is invisible in every
dialog, you get baffling "same" fields that refuse to merge.
Common causes
1. A space typed into the field Name cell
Adding or renaming a user field in Symbol Properties (or the Symbol
Editor) and catching the spacebar on the way out. The grid shows
MPN and MPN identically, so nothing looks wrong. It surfaces
later as a field that ignores the name templates you defined in
Preferences.
2. The field name ships with a library symbol
If the stray space lives in the library symbol, every placement imports it, and a schematic-side rename only fixes the instances you touch. New placements bring the space right back.
How to fix it
Delete the stray space from the field's name
- Double-click the flagged violation in the ERC dialog to jump to the symbol, then press E to open Symbol Properties.
- In the Fields grid, click the Name cell of the offending field and remove the leading or trailing space. The ERC message quotes the name — in 'MPN ' the gap before the closing quote is the bug.
- Re-run ERC (Inspect → Electrical Rules Checker).
Use when: The field exists only in the schematic. This is the whole fix for a one-off typo.
Fix the library symbol so it stays fixed
- Right-click the symbol → Edit Library Symbol, rename the field there, and save the library.
- Back in the schematic, run Tools → Update Symbols from Library… so existing placements pick up the corrected field.
- Re-run ERC.
Use when: The bad name comes from the library. Fixing only the placed instances means every future placement reintroduces the warning.
Sweep a large schematic in one pass
- Open Tools → Bulk Edit Symbol Fields… (the Symbol Fields Table).
- Look for a column that appears twice under the same name — 'MPN' and 'MPN ' render as identical headers. That tells you which symbols carry the stray-space variant.
- Fix those symbols' field names in Symbol Properties (or their library symbol), then re-run ERC.
Use when: Many symbols are flagged and you want to see the damage before editing them one by one.
When it’s safe to exclude
Almost never. The warning costs seconds to fix and there is no design in which a field name needs an invisible trailing space. What excluding would hide is real: fields that silently stop matching the name templates in Preferences, and duplicate-looking columns in BOM exports and the Symbol Fields Table.
If you must, individual markers can be excluded (right-click the marker → Exclude), or the whole check downgraded in Schematic Setup → Electrical Rules → Violation Severity. The one case that's even arguable is field names generated by an external tool you don't control, and the durable fix there is still renaming them at the source.
Gotchas
- The ERC message is its own diagnostic: the field name is printed in
quotes, so in
'MPN 'the bug is the gap you can see before the closing quote. Easy to stare past anyway. MPNandMPNare different fields. A symbol can carry both at once, and Symbol Properties will show two rows that look identical — that is the duplicate-field symptom reported in KiCad issue #18602.- KiCad 9 can't run this ERC check but complains about the same condition with a yellow infobar when the schematic opens ("This schematic contains symbols that have leading and/or trailing white space field names"). KiCad 10 does both, so fixing the names silences the infobar and the ERC warning together.
Version notes
- KiCad 10.0: Check introduced in this release.
Minimal reproduction
Give any symbol a user field whose name ends in a space. In the
schematic editor: select a symbol, press E, add a field named MPN
(with the trailing space) and any value, close the dialog, and run ERC.
The field reports:
[field_name_whitespace]: Field name has leading or trailing whitespace: 'MPN '
; warning
The checked-in file data/erc/samples/field_name_whitespace.kicad_sch
reproduces this with one embedded symbol carrying a MPN field (its
pin is capped with a no-connect so nothing else fires). Because the file
embeds its own symbol, ERC also emits one lib_symbol_issues warning
about the missing repro library; that is an artifact of the
self-contained repro, not part of this error. Renaming the field to
MPN drops the report back to that single artifact warning, which is
fix #1 in miniature.
Related errors
FAQ
KiCad says the schematic contains symbols with leading and/or trailing whitespace field names when I open it — is that this error?
Same condition, two reporting channels. The message on open is an editor infobar that KiCad has shown since version 9; the ERC violation is the KiCad 10 formalization of the same test. Removing the whitespace from the field names clears both.
How do I find where the whitespace actually is?
The ERC entry quotes the field name, so the space is visible right before the closing quote, and double-clicking the violation jumps to the symbol that owns it. For a stubborn case, open the .kicad_sch file in a text editor and look at the first quoted string of each property line — a space before its closing quote is the offender.
Is it complaining about spaces in the field's value, like a datasheet URL?
No. The check trims and compares field names only; values are never tested and may contain any whitespace. A field named MPN with the value "ABC 123" is fine. A field named "MPN " with any value is the warning.
Sources
- Check implementation — ERC_TESTER::TestFieldNameWhitespace, eeschema/erc/erc.cpp at KiCad 10.0.3
- KiCad 10 Schematic Editor manual (docs source at tag 10.0.6) — list of ERC checks
- KiCad 9 open-time infobar for the same condition — eeschema/files-io.cpp at 9.0.9.1
- KiCad issue #18602 — trailing space in a field name breaks field name template matching