{"record":{"id":"fb3c2ffc8df757b4","repo":"remotion-dev/remotion","slug":"rotation-must-be-between-0-and-90","errorCode":null,"errorMessage":"\"rotation\" must be between 0 and 90","messagePattern":"\"rotation\" must be between 0 and 90","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/effects/src/tear.ts","lineNumber":79,"sourceCode":"\tprogress: p.progress ?? DEFAULT_PROGRESS,\n\tangle: p.angle ?? DEFAULT_ANGLE,\n\trotation: p.rotation ?? DEFAULT_ROTATION,\n\tjaggedness: p.jaggedness ?? DEFAULT_JAGGEDNESS,\n});\n\nconst validateTearParams = (params: TearParams): void => {\n\tassertEffectParamsObject(params, 'Tear');\n\tassertOptionalFiniteNumber(params.progress, 'progress');\n\tassertOptionalFiniteNumber(params.angle, 'angle');\n\tassertOptionalFiniteNumber(params.rotation, 'rotation');\n\tassertOptionalFiniteNumber(params.jaggedness, 'jaggedness');\n\tconst r = resolve(params);\n\tif (r.progress < 0) {\n\t\tthrow new Error('\"progress\" must be >= 0');\n\t}\n\n\tif (r.rotation < 0 || r.rotation > 90) {\n\t\tthrow new Error('\"rotation\" must be between 0 and 90');\n\t}\n\n\tif (r.jaggedness < 0) {\n\t\tthrow new Error('\"jaggedness\" must be >= 0');\n\t}\n};\n\ntype TearState = {\n\treadonly gl: WebGL2RenderingContext;\n\treadonly program: WebGLProgram;\n\treadonly vao: WebGLVertexArrayObject;\n\treadonly vbo: WebGLBuffer;\n\treadonly texture: WebGLTexture;\n\treadonly uSource: WebGLUniformLocation | null;\n\treadonly uAngle: WebGLUniformLocation | null;\n\treadonly uProgress: WebGLUniformLocation | null;\n\treadonly uRotation: WebGLUniformLocation | null;\n\treadonly uJaggedness: WebGLUniformLocation | null;","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/effects/src/tear.ts#L61-L97","documentation":"The <Tear> effect's `rotation` parameter sets the maximum outward rotation of the torn pieces in degrees and must lie between 0 and 90 inclusive. validateTearParams throws this error after substituting the default (20) when the resolved rotation is negative or above 90. This keeps the tear visually bounded — larger rotations would blow pieces outside the frame region.","triggerScenarios":"Passing <Tear rotation={-5}>, <Tear rotation={120}>, or a dynamic value computed outside 0–90, e.g. a percentage mixed up with degrees (passing 150 instead of 15), or reusing a value configured for a different effect.","commonSituations":"Feeding the rotation a random or eased value without clamping; confusing radians with degrees or percent-of-screen with degrees; copying params from another effect with a wider rotation range.","solutions":["Clamp the value into [0, 90] before passing: Math.min(90, Math.max(0, rotation)).","If you meant a larger visual turn, note the API caps at 90 degrees — compose with angle instead.","Check unit assumptions: the value is plain degrees, not radians or percent.","Inspect dynamic sources (random(), spring overshoot) and clamp or set extrapolate: 'clamp'."],"exampleFix":"// before\n<Tear rotation={random(`rot-${frame}`) * 200} />\n\n// after\nimport {random} from 'remotion';\n<Tear rotation={Math.min(90, Math.max(0, random(`rot-${frame}`) * 200))} />","handlingStrategy":"validation","validationCode":"if (rotation !== undefined && (!Number.isFinite(rotation) || rotation < 0 || rotation > 90)) {\n  throw new RangeError(`rotation must be between 0 and 90, got ${rotation}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return <Tear rotation={r} ... />;\n} catch (e) {\n  if (e instanceof Error && e.message.includes('\"rotation\" must be between 0 and 90')) {\n    return <Tear rotation={Math.min(90, Math.max(0, r))} ... />;\n  }\n  throw e;\n}","preventionTips":["Write a clamp helper clamp(v, 0, 90) and wrap all dynamic rotation values.","Remember the unit is degrees (0–90), not radians or percent.","Clamp outputs of random() and eased/spring values before passing them as rotation.","Keep a props type like {rotation: number} and validate at the boundary where props come from user input."],"tags":["validation","remotion-effects","parameter-out-of-range","animation"],"backgroundTag":"value-out-of-range","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}