remotion-dev/remotion · error · Error
output must be "linear" or "perceptual-scale", but got
Error message
output must be "linear" or "perceptual-scale", but got ${String(output)} What it means
Thrown by assertValidInterpolateOutputOption. The output option selects how numeric interpolation is computed and accepts only the literal values 'linear', 'perceptual-scale', or undefined (defaults to linear). Any other string — including typos — is rejected.
Solutions
- Use exactly 'linear' or 'perceptual-scale' (lowercase, hyphenated).
- Omit the output option to keep the default linear behavior.
- Check for stale references to the option name in your code and docs.
Example fix
// before
const r = interpolate(t, [0, 1], [0, 100], {output: 'perceptual'});
// after
const r = interpolate(t, [0, 1], [0, 100], {output: 'perceptual-scale'}); Defensive patterns
Strategy: validation
Validate before calling
const validOutput = ['linear', 'perceptual-scale', undefined] as const;
if (output !== undefined && !validOutput.includes(output as never)) {
throw new Error('output must be "linear" or "perceptual-scale"');
}
const r = interpolate(input, inputRange, outputRange, {output}); Type guard
const isInterpolateOutput = ( v: unknown, ): v is 'linear' | 'perceptual-scale' | undefined => v === undefined || v === 'linear' || v === 'perceptual-scale';
Prevention
- Type the option as the literal union 'linear' | 'perceptual-scale'.
- Omit output to accept the default linear behavior.
- Watch for stale docs or typos when copying the option name.
When it happens
Trigger: interpolate(t,[0,1],[0,100],{output:'perceptual'}); {output:'Linear'}; {output:'srgb'}; any value not exactly 'linear' or 'perceptual-scale'.
Common situations: Typo in the option name; copy from an outdated doc/API that used different names; assuming the option accepts color-space strings like 'srgb'.
Related errors
- Cannot interpolate an input which is not a number
- Font weight outputRange must contain only numbers or strings
- forceTranscode must be a boolean.
- input can not be undefined
- inputRange can not be undefined
AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-08-12).
Data as JSON: /api/errors/d5d4be606f9473ba.
Report an issue: GitHub.
Appendix: source
Thrown at packages/core/src/interpolate.ts:1213
) {
throw new Error(
`posterize must be a positive finite number, but got ${posterize}`,
);
}
}
function assertValidInterpolateOutputOption(
output: InterpolateOptions['output'],
) {
if (
output === undefined ||
output === 'linear' ||
output === 'perceptual-scale'
) {
return;
}
throw new Error(
`output must be "linear" or "perceptual-scale", but got ${String(output)}`,
);
}
function assertValidInterpolateOutputType(
outputType: InterpolateOptions['outputType'],
) {
if (
outputType === undefined ||
outputType === 'font-weight' ||
outputType === 'scale' ||
outputType === 'translate' ||
outputType === 'rotate' ||
outputType === 'transform-origin'
) {
return;
}
View on GitHub (pinned to 46a3a6bf13)