remotion-dev/remotion · error · TypeError
outputRange must contain only numbers, or supported scale, t
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.
Source
Thrown at packages/core/src/interpolate.ts:1185
if (typeof input !== 'number') {
throw new TypeError('Cannot interpolate an input which is not a number');
}
if (!Array.isArray(outputRange)) {
throw new Error('outputRange must contain only numbers');
}
const hasStringOutput = outputRange.some(
(output) => typeof output === 'string',
);
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});
} catch (error) {
if (!outputRange.every((output) => typeof output === 'string')) {
throw error;
}
const hasNonNumericString = outputRange.some((output) => {
try {
parseStringInterpolationValue(output);
return false;
} catch (parseError) {
return parseError instanceof UnsupportedStringInterpolationValueError;
}View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Keep string outputs together only with numbers (no tuples/booleans/objects).
- Move tuple-based outputs into a separate interpolate() call.
- 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
- Keep CSS-string outputs in their own interpolate() call.
- Never mix tuples or booleans into a string-output range.
- Type string-output ranges as (string | number)[].
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
- ${name} must have at least 1 element
- outputRange can not be undefined
- inputRange (${inputRange.length}) and outputRange (${outputR
- outputRange must contain only numbers
- outputRange must contain only numbers, numeric tuples, or su
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/4ab71495b5627d3d.
Report an issue: GitHub.