remotion-dev/remotion · error · Error
outputRange can not be undefined
Error message
outputRange can not be undefined
What it means
Thrown at the top of interpolate() when the outputRange argument is undefined. Checked right after the inputRange guard, before length comparison, so the failure points clearly at the missing outputRange rather than at a downstream null-deref.
Source
Thrown at packages/core/src/interpolate.ts:1148
outputRange: readonly (number | string | readonly number[])[],
options?: InterpolateOptions,
): number | string | readonly number[];
export function interpolate(
input: number,
inputRange: readonly number[],
outputRange: readonly InterpolateOutputValue[],
options?: InterpolateOptions,
): number | string | readonly number[] {
if (typeof input === 'undefined') {
throw new Error('input can not be undefined');
}
if (typeof inputRange === 'undefined') {
throw new Error('inputRange can not be undefined');
}
if (typeof outputRange === 'undefined') {
throw new Error('outputRange can not be undefined');
}
if (inputRange.length !== outputRange.length) {
throw new Error(
'inputRange (' +
inputRange.length +
') and outputRange (' +
outputRange.length +
') must have the same length',
);
}
checkInfiniteRange('inputRange', inputRange);
checkValidInputRange(inputRange);
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
assertValidInterpolatePosterizeOption(options?.posterize);
assertValidInterpolateOutputOption(options?.output);View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Always supply a defined outputRange array.
- Default the variable to a valid output literal when it may be undefined.
- Add a runtime guard that returns early when outputRange is missing.
Example fix
// before const r = interpolate(t, [0, 1], out); // out is undefined // after const r = interpolate(t, [0, 1], out ?? [0, 100]);
Defensive patterns
Strategy: validation
Validate before calling
if (!Array.isArray(outputRange)) {
throw new Error('outputRange is required');
}
const r = interpolate(input, inputRange, outputRange); Type guard
const isOutputArray = (x: unknown): x is readonly unknown[] => Array.isArray(x);
Prevention
- Always pass outputRange as an array literal.
- Default the variable to [0, 1] when it may be undefined.
- Return early from the caller when outputRange is missing.
When it happens
Trigger: interpolate(0, [0,1], undefined); passing an outputRange variable that was never initialized; reading a missing array field from props/config.
Common situations: Forgetting to pass outputRange; building it conditionally and hitting the empty branch; destructuring a prop that does not exist.
Related errors
- ${name} must have at least 1 element
- inputRange (${inputRange.length}) and outputRange (${outputR
- outputRange must contain only numbers
- outputRange must contain only numbers, or supported scale, t
- 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/4c78926787ab7b4a.
Report an issue: GitHub.