{"record":{"id":"618ebb384eb1ccbe","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s-618ebb","errorCode":null,"errorMessage":"\"${name}\" must be greater than 0, but got ${JSON.stringify(value)}","messagePattern":"\"(.+?)\" must be greater than 0, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/rings.ts","lineNumber":142,"sourceCode":"};\n\nconst resolve = (p: RingsParams): RingsResolved => {\n\tconst thickness = p.thickness ?? DEFAULT_THICKNESS;\n\tconst gap = p.gap ?? DEFAULT_GAP;\n\n\treturn {\n\t\tcolors: p.colors ?? DEFAULT_COLORS,\n\t\tcenter: [...(p.center ?? DEFAULT_CENTER)] as RingsCenter,\n\t\tthickness,\n\t\tspacing: thickness + gap,\n\t\toffset: p.offset ?? DEFAULT_OFFSET,\n\t\tmaskToSourceAlpha: p.maskToSourceAlpha ?? DEFAULT_MASK_TO_SOURCE_ALPHA,\n\t};\n};\n\nconst 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 validateNonNegative = (value: number, name: string): void => {\n\tif (value < 0) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be greater than or equal to 0, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validateColors = (colors: unknown): void => {\n\tif (colors === undefined) {\n\t\treturn;\n\t}\n","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/rings.ts#L124-L160","documentation":"The rings effect validates that certain numeric parameters (such as thickness) are strictly greater than 0. If a value of 0 or a negative number is supplied, the effect throws a TypeError with the parameter name and the offending value. This fires after type coercion, so it strictly catches range violations on valid finite numbers.","triggerScenarios":"Passing thickness: 0, thickness: -5, or any positive-required parameter with a non-positive number. The JSON.stringify in the message shows the exact value received.","commonSituations":"Passing 0 as an uninitialized/default value; computing thickness from a ratio that produces 0 at small scales; negative values from a subtractive animation formula; conditional rendering where the parameter should be omitted but 0 is passed instead.","solutions":["Pass a value strictly greater than 0 (e.g. thickness: 4 for a visible ring)","Clamp computed values: thickness: Math.max(1, computedThickness)","If the rings should not be visible, conditionally omit the effect rather than passing 0","Animate towards a small positive epsilon instead of 0"],"exampleFix":"// before\nrings({ thickness: 0 })\n// after\nrings({ thickness: Math.max(0.1, frame * 0.5) })","handlingStrategy":"validation","validationCode":"const thickness = Math.max(0.1, frame * 0.5);\nif (thickness <= 0) throw new Error('thickness must be > 0');\nrings({ thickness });","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp positive-required parameters with Math.max(epsilon, value)","Conditionally omit the rings effect when it should not be visible instead of passing 0","Animate towards a small positive value, never exactly 0"],"tags":["validation","typescript","numeric-bounds","rings"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}