{"record":{"id":"2c4812b6c6b8643e","repo":"remotion-dev/remotion","slug":"jaggedness-must-be-0","errorCode":null,"errorMessage":"\"jaggedness\" must be >= 0","messagePattern":"\"jaggedness\" must be >= 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/effects/src/tear.ts","lineNumber":83,"sourceCode":"});\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;\n\treadonly uSide: WebGLUniformLocation | null;\n\treadonly uResolution: WebGLUniformLocation | null;\n};\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/effects/src/tear.ts#L65-L101","documentation":"The <Tear> effect's `jaggedness` parameter controls the zigzag amplitude of the tear seam in pixels and must be >= 0 (schema caps it at 100). validateTearParams throws after substituting the default (20) when the resolved jaggedness is negative. Use 0 for a perfectly straight seam; negative pixel amplitude is nonsensical.","triggerScenarios":"Passing <Tear jaggedness={-10}> explicitly, or a dynamic value that can go negative (e.g. a sinusoid like 20 * Math.sin(frame/10) without an absolute value, or interpolate() output extrapolated below the input range).","commonSituations":"Animating jaggedness with a waveform centered at 0 so negative halves throw; computing jaggedness from a measured value (canvas width, scale factor) that is unexpectedly negative; typos such as jaggedness={-0}.","solutions":["Clamp with Math.max(0, value) — or Math.abs() if a waveform centered at 0 is intended.","If using interpolate(), pass extrapolateLeft: 'clamp' (and extrapolateRight if needed).","For a straight seam pass jaggedness={0}, not a negative value.","Check any computed source value for unexpected negative results before passing it."],"exampleFix":"// before\n<Tear jaggedness={20 * Math.sin(frame / 10)} />\n\n// after\n<Tear jaggedness={Math.abs(20 * Math.sin(frame / 10))} />","handlingStrategy":"validation","validationCode":"if (jaggedness !== undefined && (!Number.isFinite(jaggedness) || jaggedness < 0)) {\n  throw new RangeError(`jaggedness must be >= 0, got ${jaggedness}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return <Tear jaggedness={j} ... />;\n} catch (e) {\n  if (e instanceof Error && e.message.includes('\"jaggedness\" must be >= 0')) {\n    return <Tear jaggedness={Math.max(0, j)} ... />;\n  }\n  throw e;\n}","preventionTips":["Use Math.abs() for waveform-driven jaggedness so the value never dips below 0.","Add extrapolateLeft: 'clamp' to any interpolate() feeding jaggedness.","For a straight seam use jaggedness={0} rather than a negative amplitude.","Sanitize measured/computed inputs (canvas sizes, scales) before passing them."],"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-14T05:17:10.506Z"}