remotion-dev/remotion · error · Error
${name} must contain only finite numbers, but got [${arr.joi
Error message
${name} must contain only finite numbers, but got [${arr.join(',')}] What it means
Thrown by checkInfiniteRange when inputRange or outputRange contains a number that is not finite — NaN, Infinity, or -Infinity. Finite math cannot interpolate to or from an infinite bound, so these are rejected even though typeof is 'number'.
Source
Thrown at packages/core/src/interpolate.ts:1031
',',
)}]`,
);
}
}
}
function checkInfiniteRange(name: string, arr: readonly number[]) {
if (arr.length < 1) {
throw new Error(name + ' must have at least 1 element');
}
for (const element of arr) {
if (typeof element !== 'number') {
throw new Error(`${name} must contain only numbers`);
}
if (!Number.isFinite(element)) {
throw new Error(
`${name} must contain only finite numbers, but got [${arr.join(',')}]`,
);
}
}
}
export function assertValidInterpolateEasingOption(
easing: EasingFunction | readonly EasingFunction[] | undefined,
inputRangeLength: number,
) {
if (easing === undefined) {
return;
}
if (typeof easing === 'function') {
return;
}
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Replace NaN/Infinity with finite fallbacks (e.g. clamp to a large finite number) before calling interpolate().
- Trace the producer of the value (look for division, log, sqrt of negatives, parseInt of non-numeric strings).
- Filter the range with Number.isFinite() at build time and drop invalid entries.
Example fix
// before const r = interpolate(t, [0, 1 / 0], [0, 100]); // after const r = interpolate(t, [0, 1], [0, 100]);
Defensive patterns
Strategy: validation
Validate before calling
const isAllFinite = (arr: readonly number[]) => arr.every(Number.isFinite);
if (!isAllFinite(inputRange) || !isAllFinite(outputRange)) {
throw new Error('ranges must contain only finite numbers');
}
const r = interpolate(input, inputRange, outputRange); Type guard
const isFiniteNumberArray = (arr: readonly unknown[]): arr is number[] => arr.every((v) => typeof v === 'number' && Number.isFinite(v));
Prevention
- Wrap range-producing math and assert Number.isFinite on each element.
- Watch for division by zero and parseInt/Float on bad input.
- Add a debug assertion that logs the offending value before the call.
When it happens
Trigger: interpolate(0, [0, Infinity], [0, 100]); interpolate(0, [0, 1], [0, NaN]); a range element computed from 1/0, Math.log(0), or parseFloat('abc').
Common situations: Division-by-zero in keyframe generation; parseFloat on malformed user input yielding NaN; math operations on undefined operands producing NaN.
Related errors
- Argument passed to "${api}" for param "${param}" is ${JSON.s
- The "from" prop of a sequence must be finite, but got ${from
- Frame ${frame} is not finite
- startFrom prop can not be NaN or Infinity.
- trimBefore prop can not be NaN or Infinity.
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/1120cad98babacea.
Report an issue: GitHub.