remotion-dev/remotion · error · Error
outputRange must contain only finite numbers, but got [${out
Error message
outputRange must contain only finite numbers, but got [${output}] What it means
Thrown by parseStringInterpolationValue when an outputRange element is a JS number that is not finite (NaN, Infinity, -Infinity). When interpolate() detects at least one string in outputRange it routes every element through this parser; a non-finite number is invalid because there is no meaningful interpolation target for it.
Source
Thrown at packages/core/src/interpolate.ts:422
if (vectorAngle.kind !== 'rotate') {
return null;
}
return {
kind: 'rotate',
values: [axis[0], axis[1], axis[2], vectorAngle.value],
units: [null, null, null, vectorAngle.unit],
dimensions: 4,
axisRotation: true,
};
};
const parseStringInterpolationValue = (
output: string | number,
): ParsedStringInterpolationValue => {
if (typeof output === 'number') {
if (!Number.isFinite(output)) {
throw new Error(
`outputRange must contain only finite numbers, but got [${output}]`,
);
}
return {
kind: 'scale',
values: [output, output, 1, 0],
units: [null, null, null, null],
dimensions: 1,
axisRotation: false,
};
}
const axisRotation = parseAxisRotationValue(output);
if (axisRotation !== null) {
return axisRotation;
}
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Sanitize the number with Number.isFinite before adding it to outputRange.
- Replace the non-finite value with a finite endpoint or use clamp on the source calculation.
Example fix
// before interpolate(t, [0, 1], ["0px", Infinity]); // after interpolate(t, [0, 1], ["0px", Number.isFinite(max) ? max : 1000]);
Defensive patterns
Strategy: validation
Validate before calling
function allFiniteOutputs(outputRange: readonly (string | number)[]): boolean {
return outputRange.every((o) => typeof o === 'string' || Number.isFinite(o));
}
if (!allFiniteOutputs(outputRange)) {
throw new Error('outputRange contains a non-finite number');
} Type guard
function isFiniteOutputRange(range: readonly (string | number)[]): range is readonly (string | number)[] {
return range.every((o) => typeof o === 'string' || (typeof o === 'number' && Number.isFinite(o)));
} Prevention
- Filter NaN/Infinity out of computed arrays before assigning them to outputRange.
- Wrap risky arithmetic (division, logs) in Number.isFinite checks.
When it happens
Trigger: interpolate(input, inputRange, outputRange) where outputRange mixes strings with a non-finite number, e.g. ["0px", Infinity], ["scale(1)", NaN], or a value computed via division by zero.
Common situations: Dividing by zero or parsing bad input upstream and feeding the result into a mixed string/number outputRange; spreading an array that accidentally contains NaN.
Related errors
- Cannot interpolate "${value}" because "${component}" is not
- String outputRange values must contain 1 to 3 components, bu
- Cannot interpolate "${output}" because it mixes ${kind} and
- Cannot interpolate ${kind} values with ${parsed.kind} values
- Cannot interpolate ${kind} values with different units on ax
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/261abb14688f51bc.
Report an issue: GitHub.