Nim "Error: undeclared identifier" in CI
Nim could not resolve a name in the current scope. Either the module that defines it was never imported, or the symbol exists but was not exported from its module with a trailing asterisk.
What this error means
Compilation fails with "Error: undeclared identifier: X" pointing at the line that uses the name. Builds pass locally when the missing import happens to be supplied elsewhere.
src/main.nim(7, 14) Error: undeclared identifier: 'parseConfig'Common causes
The defining module was not imported
The symbol lives in another module that the current file does not import, so the name is unknown in this scope.
The symbol is not exported
Nim only exports identifiers marked with a trailing * (for example proc parseConfig*). Without it the proc is private to its own module.
How to fix it
Import the module that declares the name
- Find which module defines the identifier.
- Add an
importfor that module at the top of the file using it. - Rebuild to confirm the name now resolves.
import config # brings parseConfig into scopeExport the symbol with an asterisk
Mark the proc, type, or var public so importers can see it.
proc parseConfig*(path: string): Config =
## visible to other modules now
discardHow to prevent it
- Export public API symbols with a trailing asterisk.
- Keep imports explicit at the top of each module.
- Run
nim checkin CI to catch unresolved names early.