n8n-io/n8n · error · TypeORMError

Provided "skip" value is not a number. Please provide a nume

Error message

Provided "skip" value is not a number. Please provide a numeric value.

What it means

Thrown by SelectQueryBuilder.skip when the normalized value is NaN. `skip` is the join-safe counterpart of offset and shares the same isNaN guard after normalizeNumber.

Source

Thrown at packages/@n8n/typeorm/src/query-builder/SelectQueryBuilder.ts:1375

	 * Sets maximal number of entities to take.
	 */
	take(take?: number): this {
		this.expressionMap.take = this.normalizeNumber(take);
		if (this.expressionMap.take !== undefined && isNaN(this.expressionMap.take))
			throw new TypeORMError(
				`Provided "take" value is not a number. Please provide a numeric value.`,
			);

		return this;
	}

	/**
	 * Sets number of entities to skip.
	 */
	skip(skip?: number): this {
		this.expressionMap.skip = this.normalizeNumber(skip);
		if (this.expressionMap.skip !== undefined && isNaN(this.expressionMap.skip))
			throw new TypeORMError(
				`Provided "skip" value is not a number. Please provide a numeric value.`,
			);

		return this;
	}

	/**
	 * Set certain index to be used by the query.
	 *
	 * @param index Name of index to be used.
	 */
	useIndex(index: string): this {
		this.expressionMap.useIndex = index;

		return this;
	}

	/**

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Parse and validate: `const skip = Number(raw); if (!Number.isFinite(skip)) throw ...`.
  2. Compute skip from parsed take/page only: `skip = (Number(page) - 1) * Number(take)`.
  3. Pass undefined to skip the operation entirely.

Example fix

// before
qb.skip(`${req.query.page - 1}0`); // malformed string
// after
const page = Number(req.query.page) || 1;
qb.skip((page - 1) * 10);
Defensive patterns

Strategy: validation

Validate before calling

function toSkip(value: unknown): number | undefined {
  if (value == null || value === '') return undefined;
  const n = Number(value);
  if (!Number.isFinite(n) || n < 0) throw new Error(`Invalid skip: ${String(value)}`);
  return Math.trunc(n);
}
// then: qb.skip(toSkip(req.query.skip));

Type guard

function isNonNegativeInt(v: unknown): v is number {
  return typeof v === 'number' && Number.isInteger(v) && v >= 0;
}

Prevention

When it happens

Trigger: `.skip('abc')`, `.skip('')`, `.skip(NaN)` from arithmetic on un-parsed inputs, or `.skip(req.query.cursor)` where cursor is a non-numeric token.

Common situations: Cursor/page-index passed through as string; skip computed as `(page - 1) * take` where one factor is a string, producing concatenation then NaN.

Related errors


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