{"record":{"id":"d2cc24ff485ac45d","repo":"remotion-dev/remotion","slug":"name-must-be-0","errorCode":null,"errorMessage":"\"${name}\" must be > 0","messagePattern":"\"(.+?)\" must be > 0","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/pattern.ts","lineNumber":249,"sourceCode":"\t\tthrow new TypeError(`\"${name}\" must be a [number, number] tuple`);\n\t}\n};\n\nconst assertOptionalInteger = (value: unknown, name: string): void => {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (!Number.isInteger(value)) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be an integer, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validatePositive = (value: number, name: string): void => {\n\tif (value <= 0) {\n\t\tthrow new TypeError(`\"${name}\" must be > 0`);\n\t}\n};\n\nconst validateAtLeast = (value: number, min: number, name: string): void => {\n\tif (value < min) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be >= ${min}, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validatePatternParams = (params: PatternParams): void => {\n\tassertEffectParamsObject(params, 'Pattern');\n\tassertOptionalFiniteNumber(params.scale, 'scale');\n\tassertOptionalFiniteNumber(params.cropLeft, 'cropLeft');\n\tassertOptionalFiniteNumber(params.cropTop, 'cropTop');\n\tassertOptionalFiniteNumber(params.cropRight, 'cropRight');\n\tassertOptionalFiniteNumber(params.cropBottom, 'cropBottom');","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/pattern.ts#L231-L267","documentation":"validatePositive throws when a pattern() prop that must be strictly greater than zero (notably 'scale') resolves to zero or a negative number. This protects the shader's tiling division from divide-by-zero / sign-flip artifacts.","triggerScenarios":"Calling pattern({ scale: 0 }) or pattern({ scale: -0.1 }), or animating scale down to/below zero. The check runs on the resolved value in validatePatternParams after defaults are applied.","commonSituations":"Animating scale toward zero to 'hide' the pattern; passing a negative scale to mirror (not supported); computing scale from a ratio that hits zero at the boundary frames.","solutions":["Keep scale strictly positive; the schema default is 0.1 with min 0.001.","Clamp animated scale to a small positive floor, e.g. Math.max(0.001, value).","To fade the effect out, animate opacity/amount rather than driving scale to zero."],"exampleFix":"// before\npattern({ scale: animatedScale }) // animatedScale hits 0\n\n// after\npattern({ scale: Math.max(0.001, animatedScale) })","handlingStrategy":"validation","validationCode":"// Keep scale strictly positive.\nconst scale = animatedScale <= 0 ? 0.001 : animatedScale;\npattern({ scale });","typeGuard":"const isPositive = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0;","tryCatchPattern":null,"preventionTips":["Clamp animated scale to a small positive floor (e.g. Math.max(0.001, value)).","Animate the effect's opacity/amount to hide it instead of driving scale to zero.","Validate scale against patternSchema.scale.min (0.001) before calling.","Treat negative scale as invalid input from external config and reject it early."],"tags":["validation","typescript","pattern-effect","scale","params"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}