remotion-dev/remotion · error · TypeError

outputRange must contain only numbers, or supported scale…

Error message

outputRange must contain only numbers, or supported scale, translate, and rotate strings

What it means

Thrown by interpolate() in the mixed string-output branch. When at least one output is a string (hasStringOutput), every output must be either a string or a number — the string-interpolation path supports scale/translate/rotate CSS strings mixed with numbers. If any output is neither (a tuple, boolean, object, null), this TypeError fires before interpolateString is attempted.

Solutions

  1. Keep string outputs together only with numbers (no tuples/booleans/objects).
  2. Move tuple-based outputs into a separate interpolate() call.
  3. Audit the array for any element that is not a string or number.

Example fix

// before
const r = interpolate(t, [0, 1], ['rotate(0deg)', [0, 1]]);
// after
const rot = interpolate(t, [0, 1], ['rotate(0deg)', 'rotate(90deg)']);
Defensive patterns

Strategy: validation

Validate before calling

const ok = outputRange.every(
  (o) => typeof o === 'string' || typeof o === 'number',
);
if (outputRange.some((o) => typeof o === 'string') && !ok) {
  throw new Error('string outputs may mix only with numbers');
}
const r = interpolate(input, inputRange, outputRange);

Type guard

const isStringOrNumberArray = (
  x: unknown[],
): x is (string | number)[] =>
  x.every((v) => typeof v === 'string' || typeof v === 'number');

Prevention

When it happens

Trigger: interpolate(0,[0,1],['100px', true]); interpolate(0,[0,1],['100px', [1,2]]); mixing a CSS string output with a tuple or boolean in the same outputRange.

Common situations: Combining transform-string outputs ('rotate(0deg)') with 2D tuple outputs in one array; a stray boolean from a conditional expression slipping into the array.

Related errors


AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-08-12). Data as JSON: /api/errors/4ab71495b5627d3d. Report an issue: GitHub.

Appendix: source

Thrown at packages/core/src/interpolate.ts:1357

		});
	}

	const hasStringOutput = outputRange.some(
		(output) => typeof output === 'string',
	);
	if (outputType !== undefined && outputType !== 'scale' && !hasStringOutput) {
		throw new TypeError(
			`${outputType} outputRange must contain strings with the appropriate CSS units`,
		);
	}

	if (hasStringOutput) {
		if (
			!outputRange.every(
				(output) => typeof output === 'string' || typeof output === 'number',
			)
		) {
			throw new TypeError(
				'outputRange must contain only numbers, or supported scale, translate, and rotate strings',
			);
		}

		try {
			return interpolateString({
				input,
				inputRange,
				outputRange,
				options,
				outputType,
			});
		} catch (error) {
			if (!outputRange.every((output) => typeof output === 'string')) {
				throw error;
			}

			const hasNonNumericString = outputRange.some((output) => {

View on GitHub (pinned to 46a3a6bf13)