remotion-dev/remotion · error · TypeError

Cannot interpolate ${kind} values because axis ${axis + 1} h

Error message

Cannot interpolate ${kind} values because axis ${axis + 1} has no unit

What it means

Thrown by interpolateString when, for a non-scale kind, a given axis has no unit declared in any outputRange element. Translate and rotate kinds require a unit on each interpolated axis; if every element reports null on an axis, interpolation cannot pick a unit to serialize. Because parseStringInterpolationComponent always assigns a unit to translate/rotate components, this is mostly a defensive guard for unusual dimension mismatches.

Source

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

				const unit = parsed.units[axis];
				if (unit === null) {
					continue;
				}

				if (units[axis] === null) {
					units[axis] = unit;
					continue;
				}

				if (units[axis] !== unit) {
					throw new TypeError(
						`Cannot interpolate ${kind} values with different units on axis ${axis + 1}: ${units[axis]} and ${unit}`,
					);
				}
			}

			if (units[axis] === null) {
				throw new TypeError(
					`Cannot interpolate ${kind} values because axis ${axis + 1} has no unit`,
				);
			}
		}
	}

	const values: [number, number, number, number] = [0, 0, 0, 0];
	for (let axis = 0; axis < dimensions; axis++) {
		values[axis] = interpolateNumber({
			input,
			inputRange,
			outputRange: parsedOutputRange.map((parsed) => parsed.values[axis]),
			options,
		});
	}

	return serializeStringInterpolationValue({
		kind,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Give every axis an explicit unit in every element: "0px 0px" paired with "10px 20px".
  2. Equalize the number of components across all elements.
Defensive patterns

Strategy: validation

Validate before calling

function everyAxisHasUnit(values: string[]): boolean {
  const dims = Math.max(...values.map((v) => v.trim().split(/\s+/).length));
  for (let axis = 0; axis < dims; axis++) {
    const any = values.some((v) => {
      const m = /^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/.exec(v.trim().split(/\s+/)[axis] ?? '');
      return m && m[2];
    });
    if (!any) return false;
  }
  return true;
}

if (!everyAxisHasUnit(outputRange as string[])) {
  throw new Error('Some axis has no unit in any outputRange element');
}

Prevention

When it happens

Trigger: Reachable through dimension mismatches where a shorter element leaves a higher axis null and no longer element supplies a unit on that axis, or via internal callers; uncommon from the public API because translate/rotate components always carry units.

Common situations: Mostly defensive. Could surface with carefully constructed dimension-mismatched translate values; normally the units check (292) or kind check (291) fires first.

Related errors


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