remotion-dev/remotion · error · TypeError

"${name}" must be an integer, but got ${JSON.stringify(value

Error message

"${name}" must be an integer, but got ${JSON.stringify(value)}

What it means

The zoomBlur effect requires `samples` to be an integer when provided. This check (`assertOptionalInteger`) runs after the finite-number check but before range validation, catching fractional or non-integer sample counts. The value is optional (defaults to 24), but if present must be a whole number.

Source

Thrown at packages/effects/src/zoom-blur/index.ts:93

		return;
	}

	if (
		!Array.isArray(value) ||
		value.length !== 2 ||
		value.some((item) => typeof item !== 'number' || !Number.isFinite(item))
	) {
		throw new TypeError(`"${name}" must be a [number, number] tuple`);
	}
};

const assertOptionalInteger = (value: unknown, name: string): void => {
	if (value === undefined) {
		return;
	}

	if (!Number.isInteger(value)) {
		throw new TypeError(
			`"${name}" must be an integer, but got ${JSON.stringify(value)}`,
		);
	}
};

const validateZoomBlurParams = (params: ZoomBlurParams): void => {
	assertEffectParamsObject(params, 'Zoom Blur');
	assertOptionalFiniteNumber(params.amount, 'amount');
	assertOptionalUvCoordinate(params.center, 'center');
	assertOptionalFiniteNumber(params.samples, 'samples');
	assertOptionalInteger(params.samples, 'samples');

	const r = resolve(params);
	validateNonNegative(r.amount, 'amount');
	validateUnitInterval(r.center[0], 'center[0]');
	validateUnitInterval(r.center[1], 'center[1]');
	if (r.samples < 1) {
		throw new TypeError(

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Round the value before passing: `samples: Math.round(computedSamples)`.
  2. Set the UI input step to 1 (integer) for the samples field.
  3. Omit `samples` to use the default of 24.

Example fix

// before
zoomBlur({ samples: interpolatedValue }); // 23.7

// after
zoomBlur({ samples: Math.round(interpolatedValue) });
Defensive patterns

Strategy: validation

Validate before calling

const samples = computedSamples;
if (samples !== undefined && !Number.isInteger(samples)) {
  throw new TypeError(`samples must be an integer, got ${samples}`);
}
zoomBlur({ samples });

Type guard

const isOptionalInteger = (v: unknown): v is number | undefined =>
  v === undefined || (typeof v === 'number' && Number.isInteger(v));

Prevention

When it happens

Trigger: Passing `samples: 24.5`, `samples: 12.1`, `samples: 1e0` is fine, but `samples: 3.14`, `samples: '24'` (string), or `samples: NaN` triggers it. Most commonly a UI slider with `step: 0.1` bound to the samples parameter.

Common situations: A numeric input or slider configured with a fractional step, arithmetic that produces floats (e.g., `amount / 2`), or animated values from interpolation that produce non-integer sample counts.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/c8a070a13ef48f98. Report an issue: GitHub.