{"record":{"id":"bfa65ec8a64e67d5","repo":"remotion-dev/remotion","slug":"fieldofview-must-be-max-field-of-view-but","errorCode":null,"errorMessage":"\"fieldOfView\" must be <= ${MAX_FIELD_OF_VIEW}, but got ${JSON.stringify(resolved.fieldOfView)}","messagePattern":"\"fieldOfView\" must be <= (.+?), but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/fisheye/index.ts","lineNumber":132,"sourceCode":"const 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);\n\t}\n\n\tvalidatePositive(resolved.radius, 'radius');\n\tvalidatePositive(resolved.zoom, 'zoom');\n};\n\nexport const fisheye = createEffect<FisheyeParams, FisheyeState>({\n\ttype: 'dev.remotion.effects.fisheye',\n\tlabel: 'fisheye()',\n\tdocumentationLink: 'https://www.remotion.dev/docs/effects/fisheye',\n\tbackend: 'webgl2',\n\tcalculateKey: (params) => {\n\t\tconst r = resolve(params);\n\t\treturn `fisheye-${r.fieldOfView}-${r.center.join(':')}-${r.radius}-${r.zoom}`;\n\t},\n\tsetup: (target) => setupFisheye(target),","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/fisheye/index.ts#L114-L150","documentation":"Thrown when the resolved fisheye fieldOfView exceeds MAX_FIELD_OF_VIEW (Math.PI). fieldOfView controls the lens angle; values above pi would invert geometry and break the projection math. The default 2.5 is already close to the pi ceiling, so accidental overshoot is the usual cause.","triggerScenarios":"fisheye({fieldOfView: 4}), fisheye({fieldOfView: Math.PI + 0.01}), or animating fieldOfView with interpolate/spring without clamping that pushes past ~3.14159.","commonSituations":"Spring overshoot on fieldOfView; confusing degrees (e.g. 180) with the expected radian-like range; chaining a random() that exceeds bounds.","solutions":["Cap fieldOfView at Math.PI: fisheye({fieldOfView: Math.min(Math.PI, value)}).","Use interpolate(value, [0,1], [1, Math.PI], {extrapolateRight: 'clamp'}).","Stay in the documented working range (roughly 1 to 3)."],"exampleFix":"// before\nfisheye({fieldOfView: spring({frame, fps}) * 3});\n// after\nfisheye({\n  fieldOfView: Math.min(\n    Math.PI,\n    interpolate(spring({frame, fps}) * 3, [0, 3], [1, 3], {\n      extrapolateRight: 'clamp',\n    }),\n  ),\n});","handlingStrategy":"validation","validationCode":"const MAX_FOV = Math.PI;\nconst fieldOfView = Math.min(MAX_FOV, Math.max(0, animatedFov));\nfisheye({fieldOfView});","typeGuard":"const isValidFov = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0 && v <= Math.PI;","tryCatchPattern":null,"preventionTips":["Treat fieldOfView as radians in [0, Math.PI]; never pass degrees.","Clamp spring/interpolate outputs that feed fieldOfView.","Remember the default 2.5 is already near the pi ceiling, so small overshoots trip the guard."],"tags":["validation","fisheye","effects","range","field-of-view"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}