ErrLookup › Background articles › TypeORMError explained: why TypeORM throws its base error class for bad decorators, where filters, and schema mismatches

TypeORMError explained: why TypeORM throws its base error class for bad decorators, where filters, and schema mismatches

TypeORMError is the base error class TypeORM throws for configuration defects, unsafe query inputs, and schema-guard failures before any SQL reaches the database. Developers meet it as 'Undefined value encountered in property...' in find() filters, 'Dependency Cycle Found' at startup, 'was not found in table...' during migrations, and dozens of similar guard messages. This family covers the 334 documented TypeORMError records across the typeorm and n8n repositories and explains the shared mechanism behind them.

Distilled from 334 documented records across 2 repositories.

Background

TypeORMError is TypeORM's own base error class, thrown by the framework itself rather than surfaced from the database driver. It appears across three layers of the stack: metadata validation at DataSource startup, query building before SQL is emitted, and schema synchronization or migration execution. Because it is a guard, almost every TypeORMError means TypeORM refused to do something that would otherwise produce a wrong result or invalid SQL — it is a fail-fast boundary, not a downstream database failure.

The class does two broad jobs. First, it protects query semantics: the where-criteria normalizer throws on null and undefined values in where objects because those would otherwise be dropped or silently expanded into column = NULL, yielding broader result sets than the caller intended. Second, it validates configuration and schema state: the metadata builder throws when a relation target is unregistered, a join column references a nonexistent property, an index points at a non-column, or a cycle of non-nullable join columns would make inserts impossible. Both jobs share the same shape — name the offending property, table, or value, and stop before damage is done.

From the caller's side, the lifecycle position tells you which subsystem to blame. Errors at startup (dependency cycles, missing entity metadata, SQLite composite autoincrement, abstract-driver misuse) come from metadata building during DataSource initialization. Errors at query time (where value guards, empty write criteria, query-builder alias misuse, aggregate column lookup) come from query construction. Errors during synchronize or migrations (constraint, view, and column not found in the cache; JSON default comparison failures) come from schema comparison against TypeORM's in-memory table/view cache rather than the live database.

The family spans two repositories because n8n bundles TypeORM as its persistence layer. n8n's TypeORMError records — aggregate column lookup, entity metadata resolution, index and referenced-column building — are the same machinery invoked from n8n's own entity usage; nothing about them is n8n-specific. Where individual messages differ in wording or trigger conditions, the behavior is library-version-specific rather than a divergence in mechanism.

Common causes

What usually fixes it

Documented occurrences

…and 314 more across the corpus — use search.

Honest provenance: generated on 2026-08-12 from AI-assisted analysis of the linked records. See how records are made.