n8n-io/n8n · error · TypeORMError

Value "${value}" is not a number.

Error message

Value "${value}" is not a number.

What it means

In EntityManager.increment, after the column is resolved, the supplied value is coerced via Number(value) and checked with isNaN. If it isn't a finite number (NaN, undefined-coerced, non-numeric string), TypeORM throws `Value "${value}" is not a number.`. The check uses Number() rather than typeof, so empty strings and booleans pass while 'abc', undefined, or symbols fail.

Source

Thrown at packages/@n8n/typeorm/src/entity-manager/EntityManager.ts:1180

	}

	/**
	 * Increments some column by provided value of the entities matched given conditions.
	 */
	async increment<Entity extends ObjectLiteral>(
		entityClass: EntityTarget<Entity>,
		conditions: any,
		propertyPath: string,
		value: number | string,
	): Promise<UpdateResult> {
		const metadata = this.connection.getMetadata(entityClass);
		const column = metadata.findColumnWithPropertyPath(propertyPath);
		if (!column)
			throw new TypeORMError(
				`Column ${propertyPath} was not found in ${metadata.targetName} entity.`,
			);

		if (isNaN(Number(value))) throw new TypeORMError(`Value "${value}" is not a number.`);

		// convert possible embeded path "social.likes" into object { social: { like: () => value } }
		const values: QueryDeepPartialEntity<Entity> = propertyPath.split('.').reduceRight(
			(value, key) => ({ [key]: value }) as any,
			() => this.connection.driver.escape(column.databaseName) + ' + ' + value,
		);

		return this.createQueryBuilder<Entity>(entityClass as any, 'entity')
			.update(entityClass)
			.set(values)
			.where(conditions)
			.execute();
	}

	/**
	 * Decrements some column by provided value of the entities matched given conditions.
	 */
	async decrement<Entity extends ObjectLiteral>(

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Coerce and validate the value upstream: `const n = Number(value); if (!Number.isFinite(n)) throw ...`.
  2. Type the parameter as `number` in your service signature so TS rejects string inputs at compile time.
  3. If accepting string input, parse with `Number.parseFloat` and a guard before calling increment.
  4. For null/undefined optional amounts, default to 0 explicitly or skip the call.

Example fix

// before - raw user input
await manager.increment(Counter, { id }, req.body.amount);

// after - coerce and validate
const amount = Number(req.body.amount);
if (!Number.isFinite(amount)) {
  throw new UserError('amount must be a number');
}
await manager.increment(Counter, { id }, amount);
Defensive patterns

Strategy: validation

Validate before calling

function asFiniteNumber(v: unknown, field = 'value'): number {
  const n = Number(v);
  if (!Number.isFinite(n)) throw new UserError(`${field} must be a finite number`);
  return n;
}
await manager.increment(Entity, conditions, propertyPath, asFiniteNumber(rawValue));

Type guard

function isNumericValue(v: unknown): v is number | string {
  return typeof v === 'number' ? Number.isFinite(v) : typeof v === 'string' && v.trim() !== '' && Number.isFinite(Number(v));
}

Prevention

When it happens

Trigger: Passing a user-controlled or unvalidated string like 'abc' as the increment amount; passing `undefined` accidentally; passing a BigInt (Number(bigint) beyond safe range becomes odd values but small BigInt actually works); passing an object whose toString yields non-numeric text; passing null (Number(null)===0, so it does NOT fire — be aware).

Common situations: Form/API input not parsed to a number before reaching increment; default value of an optional parameter silently undefined; a JSON payload where amount came as a string;BigInt/Decimal.js instances that don't coerce cleanly.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/004228515a04f59c. Report an issue: GitHub.