n8n-io/n8n · error · TypeError
Unsupported FindOperator ${FindOperator.constructor.name}
Error message
Unsupported FindOperator ${FindOperator.constructor.name} What it means
createWhereConditionExpression() switch on condition.operator falls through to a TypeError when the operator is none of the handled cases (lessThan, lessThanOrEqual, arrayContains, jsonContains, arrayContainedBy, arrayOverlap, moreThan, moreThanOrEqual, notEqual, equal, ilike, like, between, in, any, isNull, not, brackets, and, or). A FindOperator with an unrecognised type reaches this throw — typically a custom FindOperator or a version mismatch where a newer operator isn't handled.
Source
Thrown at packages/@n8n/typeorm/src/query-builder/QueryBuilder.ts:998
return '0=1';
}
return `${condition.parameters[0]} IN (${condition.parameters.slice(1).join(', ')})`;
case 'any':
return `${condition.parameters[0]} = ANY(${condition.parameters[1]})`;
case 'isNull':
return `${condition.parameters[0]} IS NULL`;
case 'not':
return `NOT(${this.createWhereConditionExpression(condition.condition)})`;
case 'brackets':
return `${this.createWhereConditionExpression(condition.condition, true)}`;
case 'and':
return '(' + condition.parameters.join(' AND ') + ')';
case 'or':
return '(' + condition.parameters.join(' OR ') + ')';
}
throw new TypeError(`Unsupported FindOperator ${FindOperator.constructor.name}`);
}
protected createCteExpression(): string {
if (!this.hasCommonTableExpressions()) {
return '';
}
const databaseRequireRecusiveHint =
this.connection.driver.cteCapabilities.requiresRecursiveHint;
const cteStrings = this.expressionMap.commonTableExpressions.map((cte) => {
const cteBodyExpression =
typeof cte.queryBuilder === 'string' ? cte.queryBuilder : cte.queryBuilder.getQuery();
if (typeof cte.queryBuilder !== 'string') {
if (cte.queryBuilder.hasCommonTableExpressions()) {
throw new TypeORMError(`Nested CTEs aren't supported (CTE: ${cte.alias})`);
}
if (
!this.connection.driver.cteCapabilities.writable &&View on GitHub (pinned to 5ac6606e81)
Solutions
- Use only built-in FindOperator factory functions (LessThan, MoreThan, Equal, ILike, Between, In, Any, ArrayContains, etc.).
- If a custom predicate is needed, pass it as a raw where string (Brackets or string) instead of a FindOperator.
- Verify the operator string exactly matches a case label in createWhereConditionExpression for this TypeORM version.
- On a fork, extend the switch to handle the operator before using it.
Example fix
// before
qb.where({ status: new FindOperator('regex', value) }); // 'regex' not in switch
// after — use a raw where string for unsupported predicates
qb.where('status ~ :pattern', { pattern: value }); Defensive patterns
Strategy: type-guard
Validate before calling
const SUPPORTED_OPS = new Set(['lessThan','lessThanOrEqual','arrayContains','jsonContains','arrayContainedBy','arrayOverlap','moreThan','moreThanOrEqual','notEqual','equal','ilike','like','between','in','any','isNull','not','brackets','and','or']);
function isSupportedOperator(op: string): boolean { return SUPPORTED_OPS.has(op); }
if (customOp && !isSupportedOperator((customOp as any)._type)) throw new Error('unsupported FindOperator type'); Type guard
function isSupportedFindOperator(op: string): boolean {
return new Set(['lessThan','lessThanOrEqual','arrayContains','jsonContains','arrayContainedBy','arrayOverlap','moreThan','moreThanOrEqual','notEqual','equal','ilike','like','between','in','any','isNull','not','brackets','and','or']).has(op);
} Prevention
- Use only built-in FindOperator factory functions.
- For custom predicates, pass raw where strings or Brackets, not FindOperators.
- Verify the operator type is in the createWhereConditionExpression switch for this version.
- On a fork, extend the switch before introducing a new operator.
When it happens
Trigger: Constructing a FindOperator with an operator type string not covered by the switch and passing it into a where clause (e.g. via FindOperator constructor or a custom operator factory). Also after upgrading TypeORM where a new operator exists in FindOperatorType but createWhereConditionExpression wasn't updated.
Common situations: Custom FindOperator subclasses for vendor-specific predicates. Monkeypatching FindOperatorType. Version skew between @n8n/typeorm fork and a plugin expecting upstream operator support.
Related errors
- Cannot find alias for property ${propertyPath}
- Cannot get entity metadata for the given alias "${this.name}
- OUTPUT or RETURNING clause only supported by Microsoft SQL S
- OUTPUT or RETURNING clause only supported by Microsoft SQL S
- indexPredicate option is not supported by the current databa
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/e0e199f0447ab2b8.
Report an issue: GitHub.