{"record":{"id":"df9f476d13740a9b","repo":"remotion-dev/remotion","slug":"progress-must-be-0","errorCode":null,"errorMessage":"\"progress\" must be >= 0","messagePattern":"\"progress\" must be >= 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/effects/src/tear.ts","lineNumber":75,"sourceCode":"\treadonly jaggedness?: number;\n};\n\nconst resolve = (p: TearParams) => ({\n\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;","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/effects/src/tear.ts#L57-L93","documentation":"The <Tear> effect validates its parameters before rendering. `progress` controls how far the tear has ripped (0 = intact; values above 1 push the pieces farther apart). After substituting defaults, the effect throws if the resolved progress is negative, since a negative progress is meaningless. Note the check runs on the RESOLVED value, so passing undefined is fine (defaults to 0.5) but explicitly passing a negative number fails.","triggerScenarios":"Calling <Tear progress={-0.1}> (or any negative number), or animating progress from a value that dips below 0, e.g. spring()/interpolate() output that undershoots (overshoot clamping disabled), or passing a NaN-adjacent calculation result that resolves negative after the finite-number assertion.","commonSituations":"Driving progress from a spring with damping that swings negative at the start; computing progress as (frame - startFrame)/duration where the frame is before startFrame; typo in a constant like progress={-1} intending 1.","solutions":["Clamp progress to >= 0 before passing it: Math.max(0, value).","If using interpolate(), set extrapolateLeft: 'clamp' so early frames do not produce negative values.","Check the frame math driving the animation — ensure the range start is not before the animation begins.","Verify the literal value: a negative sign may be a typo (progress={-1} vs progress={1})."],"exampleFix":"// before\n<Tear progress={frame / durationInFrames} />\n\n// after\n<Tear\n  progress={Math.max(0, frame / durationInFrames)}\n/>","handlingStrategy":"validation","validationCode":"if (progress !== undefined && (!Number.isFinite(progress) || progress < 0)) {\n  throw new RangeError(`progress must be >= 0, got ${progress}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  return <Tear progress={p} ... />;\n} catch (e) {\n  if (e instanceof Error && e.message.includes('\"progress\" must be >= 0')) {\n    return <Tear progress={Math.max(0, p)} ... />;\n  }\n  throw e;\n}","preventionTips":["Always clamp animated progress: Math.max(0, value).","Use interpolate() with extrapolateLeft: 'clamp' for frame-derived progress.","Check spring() overshoot — clamp its output if feeding progress.","Guard against frame-before-start computations ((frame - startFrame) can be negative)."],"tags":["validation","animation","remotion-effects","parameter-out-of-range"],"backgroundTag":"invalid-argument-value","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"}