remotion-dev/remotion · error · TypeError

outputRange tuples must all have the same length, but got ${

Error message

outputRange tuples must all have the same length, but got ${dimensions} and ${output.length}

What it means

Thrown by validateTupleOutputRange when outputRange tuples have differing lengths. The first tuple's length sets the expected dimensionality and every subsequent tuple must match it, because interpolateTuple interpolates axis-by-axis across all tuples.

Source

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

		? outputRange[range + 1]
		: outputRange[range];
};

const validateTupleOutputRange = (
	outputRange: readonly (readonly unknown[])[],
): number => {
	const dimensions = outputRange[0]?.length;
	if (dimensions === undefined) {
		throw new Error('outputRange must have at least 1 element');
	}

	if (dimensions === 0) {
		throw new TypeError('outputRange tuples must contain at least 1 number');
	}

	for (const output of outputRange) {
		if (output.length !== dimensions) {
			throw new TypeError(
				`outputRange tuples must all have the same length, but got ${dimensions} and ${output.length}`,
			);
		}

		for (const value of output) {
			if (typeof value !== 'number' || !Number.isFinite(value)) {
				throw new TypeError(
					`outputRange tuples must contain only finite numbers, but got [${output.join(
						',',
					)}]`,
				);
			}
		}
	}

	return dimensions;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Pad or trim every tuple to the same length: [[0, 0], [2, 3]].
  2. Validate tuple lengths against the first tuple before calling interpolate().

Example fix

// before
interpolate(t, [0, 1], [[0, 1], [2]]);
// after
interpolate(t, [0, 1], [[0, 1], [2, 3]]);
Defensive patterns

Strategy: validation

Validate before calling

const dims = (outputRange as readonly unknown[][])[0]?.length;
if (!outputRange.every((t) => Array.isArray(t) && t.length === dims)) {
  throw new Error(`All tuples must have length ${dims}`);
}

Type guard

function isUniformTuples<T extends readonly number[]>(arr: readonly T[]): boolean {
  const n = arr[0]?.length;
  return n !== undefined && arr.every((t) => t.length === n);
}

Prevention

When it happens

Trigger: interpolate(t, [0, 1], [[0, 1], [2]]) (2 vs 1), [[0], [1, 2, 3]] (1 vs 3), or any ragged tuple outputRange.

Common situations: Conditionally pushing different numbers of values per keyframe; refactoring a tuple outputRange and forgetting to update every entry; off-by-one when zipping arrays.

Related errors


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