remotion-dev/remotion · error · TypeError
outputRange tuples must contain only finite numbers, but got
Error message
outputRange tuples must contain only finite numbers, but got [${output.join(',')}] What it means
Thrown by validateTupleOutputRange when interpolate() is called with a multi-dimensional (tuple) outputRange. The validator walks every value inside every tuple and rejects any element that is not a finite number. NaN, Infinity, -Infinity, strings, null, and undefined inside a tuple all trigger it.
Source
Thrown at packages/core/src/interpolate.ts:973
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;
};
const interpolateTuple = ({
input,
inputRange,
outputRange,
options,
}: {
input: number;View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Strip any unit strings from tuple elements; tuples only take raw numbers.
- Check every tuple element with Number.isFinite() before calling interpolate().
- Find the source of NaN/Infinity (e.g. division by zero, Math.log of a non-positive) in the code that builds the tuple.
Example fix
// before const x = interpolate(t, [0, 1], [[0, 'px'], [100, 'px']]); // after const x = interpolate(t, [0, 1], [[0, 0], [100, 0]]);
Defensive patterns
Strategy: validation
Validate before calling
const isFiniteTuple = (t: unknown): t is number[] =>
Array.isArray(t) && t.every((v) => typeof v === 'number' && Number.isFinite(v));
if (!outputRange.every(isFiniteTuple)) {
throw new Error('outputRange tuples must be finite number arrays');
}
const r = interpolate(input, inputRange, outputRange as number[][]); Type guard
const isFiniteTupleArray = (x: unknown): x is number[][] => Array.isArray(x) && x.every((t) => Array.isArray(t) && t.every((v) => typeof v === 'number' && Number.isFinite(v)));
Prevention
- Type outputRange as number[][] so non-number tuple members fail at compile time.
- Build tuple outputs from already-validated number sources.
- Never put CSS unit strings inside tuples; use the string-output path for units.
When it happens
Trigger: Calling interpolate() whose outputRange is an array of arrays, where at least one inner tuple contains a non-number or a non-finite number. Examples: interpolate(0, [0,1], [[0,'px'],[100,'px']]); interpolate(0,[0,1],[[0,NaN],[1,2]]); interpolate(0,[0,1],[[0,null],[1,2]]).
Common situations: Animating 2D positions, scale pairs, or matrix-like values via tuple output, but accidentally leaving string units ('px','%') inside the tuples, or computing a tuple element from a division that yields NaN/Infinity.
Related errors
- ${name} must contain only numbers
- Cannot interpolate an input which is not a number
- outputRange must contain only numbers
- outputRange must contain only numbers, numeric tuples, or su
- inputRange must be strictly monotonically increasing but got
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/aea03c1358989e1b.
Report an issue: GitHub.