remotion-dev/remotion · error · TypeError
Cannot interpolate " " as because it is a transform-origin…
Error message
Cannot interpolate "${output}" as ${outputType} because it is a transform-origin value What it means
interpolate() infers the transform kind (scale, translate, rotate, etc.) of string output values; all outputs must be the same kind and match the declared outputType. When the inferred kind differs from outputType, a TypeError is thrown because values of different transform kinds cannot be interpolated together.
Solutions
- Correct outputType to match the actual output values (e.g. 'translate' for px values).
- Make all output range values the same transform kind.
- Remove outputType and let interpolation infer, or split into separate interpolations.
Example fix
// before
interpolate(f, [0,1], ['0px','100px'], {outputType: 'scale'})
// after
interpolate(f, [0,1], ['0px','100px'], {outputType: 'translate'}) Defensive patterns
Strategy: validation
Validate before calling
const kinds = outputs.map(inferKind); // e.g. px->translate, unitless->scale
if (new Set(kinds).size > 1) throw new Error('mixed transform kinds'); Try / catch
try {
interpolate(f, r, vals, {outputType});
} catch (e) {
if (e instanceof TypeError) normalizeOutputRange();
} Prevention
- Keep all output values the same kind (all px, all unitless, etc.).
- Update outputType when changing animation values.
- Validate ranges with a helper before calling interpolate.
When it happens
Trigger: interpolate called with string outputs like '10px' (translate) or '1.5' (scale) plus an outputType that doesn't match the inferred kind; mixing kinds across the output range triggers a sibling error and mismatched outputType triggers this one.
Common situations: Passing 'translate' values with outputType: 'scale'; refactoring animations and leaving a stale outputType; mixing '10px' and '50%' values in one 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
- bezier x values must be in [0, 1] range
- Cannot interpolate " " as because it is a rotate value
- A "duration" of a spring is NaN, which it must not be
- A "duration" of a spring must be a "number" but is
- A "duration" of a spring must be finite, but is
AI-assisted analysis of remotion-dev/remotion@46a3a6bf13 (2026-09-18).
Data as JSON: /api/errors/2ed99ab5613606d6.
Report an issue: GitHub.
Appendix: source
Thrown at packages/core/src/interpolate.ts:500
}
return parseTransformOriginValue(output, parts);
}
const parsed = parts.map((part) =>
parseStringInterpolationComponent(part, output),
);
const [{kind}] = parsed;
for (const part of parsed) {
if (part.kind !== kind) {
throw new TypeError(
`Cannot interpolate "${output}" because it mixes ${kind} and ${part.kind} values`,
);
}
}
if (outputType !== undefined && outputType !== kind) {
throw new TypeError(
`Cannot interpolate "${output}" as ${outputType} because it is a ${kind} value`,
);
}
if (kind === 'scale') {
const x = parsed[0].value;
const y = parsed[1]?.value ?? x;
const z = parsed[2]?.value ?? 1;
return {
kind,
values: [x, y, z, 0],
units: [null, null, null, null],
dimensions: parsed.length,
axisRotation: false,
};
}
return {View on GitHub (pinned to 46a3a6bf13)