remotion-dev/remotion · error · TypeError

"${name}" must be greater than 0, but got ${JSON.stringify(v

Error message

"${name}" must be greater than 0, but got ${JSON.stringify(value)}

What it means

Thrown by validatePositive inside validateFisheyeParams when the resolved 'radius' or 'zoom' value is zero or negative. The fisheye distortion math divides by these magnitudes, so non-positive values would produce infinite or inverted distortion. Defaults (radius=1, zoom=1) are safe, so this only fires when a caller explicitly supplies a non-positive number.

Source

Thrown at packages/effects/src/fisheye/index.ts:116

});

const assertOptionalUvCoordinate = (value: unknown, name: string): void => {
	if (value === undefined) {
		return;
	}

	if (
		!Array.isArray(value) ||
		value.length !== 2 ||
		value.some((item) => typeof item !== 'number' || !Number.isFinite(item))
	) {
		throw new TypeError(`"${name}" must be a [number, number] tuple`);
	}
};

const validatePositive = (value: number, name: string): void => {
	if (value <= 0) {
		throw new TypeError(
			`"${name}" must be greater than 0, but got ${JSON.stringify(value)}`,
		);
	}
};

const validateFisheyeParams = (params: FisheyeParams): void => {
	assertEffectParamsObject(params, 'Fisheye');
	assertOptionalFiniteNumber(params.fieldOfView, 'fieldOfView');
	assertOptionalUvCoordinate(params.center, 'center');
	assertOptionalFiniteNumber(params.radius, 'radius');
	assertOptionalFiniteNumber(params.zoom, 'zoom');

	const resolved = resolve(params);
	validateNonNegative(resolved.fieldOfView, 'fieldOfView');
	if (resolved.fieldOfView > MAX_FIELD_OF_VIEW) {
		throw new TypeError(
			`"fieldOfView" must be <= ${MAX_FIELD_OF_VIEW}, but got ${JSON.stringify(resolved.fieldOfView)}`,
		);

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use a strictly positive value: fisheye({radius: 1, zoom: 1}).
  2. Clamp animated inputs with Math.max(epsilon, value) or Remotion's interpolate(..., {extrapolateLeft: 'clamp'}).
  3. Omit radius/zoom to fall back to the default of 1.

Example fix

// before
fisheye({radius: spring({frame, fps})}); // spring can overshoot <=0
// after
fisheye({
  radius: Math.max(0.001, spring({frame, fps})),
});
Defensive patterns

Strategy: validation

Validate before calling

const radius = animatedRadius <= 0 ? 1 : animatedRadius;
const zoom = animatedZoom <= 0 ? 1 : animatedZoom;
fisheye({radius, zoom});

Type guard

const isPositive = (v: unknown): v is number =>
  typeof v === 'number' && Number.isFinite(v) && v > 0;

Prevention

When it happens

Trigger: fisheye({radius: 0}), fisheye({zoom: -2}), fisheye({radius: -0.01}), or computing radius/zoom from an animation that crosses zero (e.g. interpolate() without a clamp).

Common situations: Driving radius/zoom with an animated spring whose overshoot dips below zero; passing a counter that starts at 0; typo of 0 instead of 1 as a 'default'.

Related errors


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