{"record":{"id":"fb238579fe43894e","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s-fb2385","errorCode":null,"errorMessage":"\"${name}\" must be greater than 0, but got ${JSON.stringify(value)}","messagePattern":"\"(.+?)\" must be greater than 0, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/fisheye/index.ts","lineNumber":116,"sourceCode":"});\n\nconst assertOptionalUvCoordinate = (value: unknown, name: string): void => {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (\n\t\t!Array.isArray(value) ||\n\t\tvalue.length !== 2 ||\n\t\tvalue.some((item) => typeof item !== 'number' || !Number.isFinite(item))\n\t) {\n\t\tthrow new TypeError(`\"${name}\" must be a [number, number] tuple`);\n\t}\n};\n\nconst validatePositive = (value: number, name: string): void => {\n\tif (value <= 0) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be greater than 0, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validateFisheyeParams = (params: FisheyeParams): void => {\n\tassertEffectParamsObject(params, 'Fisheye');\n\tassertOptionalFiniteNumber(params.fieldOfView, 'fieldOfView');\n\tassertOptionalUvCoordinate(params.center, 'center');\n\tassertOptionalFiniteNumber(params.radius, 'radius');\n\tassertOptionalFiniteNumber(params.zoom, 'zoom');\n\n\tconst resolved = resolve(params);\n\tvalidateNonNegative(resolved.fieldOfView, 'fieldOfView');\n\tif (resolved.fieldOfView > MAX_FIELD_OF_VIEW) {\n\t\tthrow new TypeError(\n\t\t\t`\"fieldOfView\" must be <= ${MAX_FIELD_OF_VIEW}, but got ${JSON.stringify(resolved.fieldOfView)}`,\n\t\t);","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/fisheye/index.ts#L98-L134","documentation":"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.","triggerScenarios":"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).","commonSituations":"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'.","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."],"exampleFix":"// before\nfisheye({radius: spring({frame, fps})}); // spring can overshoot <=0\n// after\nfisheye({\n  radius: Math.max(0.001, spring({frame, fps})),\n});","handlingStrategy":"validation","validationCode":"const radius = animatedRadius <= 0 ? 1 : animatedRadius;\nconst zoom = animatedZoom <= 0 ? 1 : animatedZoom;\nfisheye({radius, zoom});","typeGuard":"const isPositive = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0;","tryCatchPattern":null,"preventionTips":["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."],"tags":["validation","fisheye","effects","positive-number","animation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}