remotion-dev/remotion · error · TypeError

Cannot interpolate " " as because it is a rotate value

Error message

Cannot interpolate "${output}" as ${outputType} because it is a rotate value

What it means

interpolate() supports interpolating string transform values. When the output range contains a rotate value (e.g. '45deg') but the declared outputType is something else (or the mix is invalid), a TypeError is thrown because rotate values cannot be interpolated as a different transform kind.

Solutions

  1. Set outputType: 'rotate' (or omit outputType) when outputs are rotate values.
  2. Remove rotation strings from the output range or convert to numbers.
  3. Split the interpolation so each outputType gets its own interpolate call.

Example fix

// before
interpolate(f, [0,1], ['0deg','45deg'], {outputType: 'scale'})
// after
interpolate(f, [0,1], ['0deg','45deg'], {outputType: 'rotate'})
Defensive patterns

Strategy: validation

Validate before calling

const isRotate = (v: string) => /deg|rad|grad|turn$/.test(v.trim());
if (outputs.some(isRotate) && outputType !== undefined && outputType !== 'rotate')
  throw new Error('rotate values require outputType rotate');

Try / catch

try {
  interpolate(f, r, vals, {outputType});
} catch (e) {
  if (e instanceof TypeError) retryWithoutOutputType();
}

Prevention

When it happens

Trigger: Calling interpolate with string outputs parsed as axis rotations (like '30deg' or 'rotateX(...)') while outputType is set to 'scale', 'translate', etc.

Common situations: Passing CSS transform strings with rotation into interpolate and specifying an incorrect outputType; mixing rotate and non-rotate endpoints in the output range.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18). Data as JSON: /api/errors/9a4af2a7fdde623f. Report an issue: GitHub.

Appendix: source

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

	if (outputType === 'transform-origin') {
		const transformOriginParts = output.trim().split(/\s+/);
		if (
			transformOriginParts.length < 1 ||
			transformOriginParts.length > 3 ||
			transformOriginParts[0] === ''
		) {
			throw new TypeError(
				`String outputRange values must contain 1 to 3 components, but got "${output}"`,
			);
		}

		return parseTransformOriginValue(output, transformOriginParts);
	}

	const axisRotation = parseAxisRotationValue(output);
	if (axisRotation !== null) {
		if (outputType !== undefined && outputType !== 'rotate') {
			throw new TypeError(
				`Cannot interpolate "${output}" as ${outputType} because it is a rotate value`,
			);
		}

		return axisRotation;
	}

	const parts = output.trim().split(/\s+/);
	if (parts.length < 1 || parts.length > 3 || parts[0] === '') {
		throw new TypeError(
			`String outputRange values must contain 1 to 3 components, but got "${output}"`,
		);
	}

	if (parts.some((part) => transformOriginKeywords.has(part.toLowerCase()))) {
		if (outputType !== undefined) {
			throw new TypeError(
				`Cannot interpolate "${output}" as ${outputType} because it is a transform-origin value`,

View on GitHub (pinned to 46a3a6bf13)