remotion-dev/remotion · error · Error

output must be "linear" or "perceptual-scale", but got ${Str

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.

Source

Thrown at packages/core/src/interpolate.ts:1093

	) {
		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)}`,
	);
}

/*
 * @description Allows you to map a range of values to another using a concise syntax.
 * @see [Documentation](https://remotion.dev/docs/interpolate)
 */
/* eslint-disable no-redeclare */
export function interpolate(
	input: number,
	inputRange: readonly number[],
	outputRange: readonly number[],
	options?: InterpolateOptions,
): number;
export function interpolate(
	input: number,
	inputRange: readonly number[],

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use exactly 'linear' or 'perceptual-scale' (lowercase, hyphenated).
  2. Omit the output option to keep the default linear behavior.
  3. 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

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


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/d5d4be606f9473ba. Report an issue: GitHub.