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
- Use a strictly positive value: fisheye({radius: 1, zoom: 1}).
- Clamp animated inputs with Math.max(epsilon, value) or Remotion's interpolate(..., {extrapolateLeft: 'clamp'}).
- 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
- Clamp animated radius/zoom with Math.max(epsilon, value) so springs that overshoot cannot hit zero.
- Use Remotion interpolate(..., {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'}) for any easing into these props.
- Default to omitting radius/zoom unless a non-default value is required.
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
- "${name}" must be a [number, number] tuple
- "fieldOfView" must be <= ${MAX_FIELD_OF_VIEW}, but got ${JSO
- "size" must be greater than 0, but got ${JSON.stringify(reso
- The "width" and "height" props must be numbers on <Img> when
- The ${formatPropList(conflictingProps)} prop${conflictingPro
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/fb238579fe43894e.
Report an issue: GitHub.