{"record":{"id":"1c059c07f85b4dee","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-or-equal-to-0-but","errorCode":null,"errorMessage":"\"${name}\" must be greater than or equal to 0, but got ${JSON.stringify(value)}","messagePattern":"\"(.+?)\" must be greater than or equal to 0, but got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/checkerboard.ts","lineNumber":156,"sourceCode":"\t\tspacing: cellSize + gap,\n\t\tangle: p.angle ?? DEFAULT_ANGLE,\n\t\toffsetX: p.offsetX ?? DEFAULT_OFFSET_X,\n\t\toffsetY: p.offsetY ?? DEFAULT_OFFSET_Y,\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\n\tif (!Array.isArray(colors) || colors.length < 2) {\n\t\tthrow new TypeError(\n\t\t\t`\"colors\" must be an array with at least 2 colors, but got ${JSON.stringify(colors)}`,\n\t\t);\n\t}\n\n\tfor (let i = 0; i < colors.length; i++) {\n\t\tassertRequiredColor(colors[i], `colors[${i}]`);","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/checkerboard.ts#L138-L174","documentation":"Thrown by validateNonNegative() during checkerboard validation when a numeric prop that may be zero but not negative is < 0. In the shipped validator this is applied to gap (transparent spacing between cells). It is a TypeError raised during parameter validation, before any GL setup.","triggerScenarios":"Passing <Checkerboard gap={-1} /> or a keyframed gap that dips below 0; validateCheckerboardParams() calls validateNonNegative(gap,'gap') which throws at checkerboard.ts:156 because value < 0.","commonSituations":"Negative gap from a dynamic data source, animation overshoot below zero, or assuming gap can be negative to overlap cells (it cannot).","solutions":["Set gap to 0 or a positive number of pixels.","Clamp animated gap with Math.max(0, value).","Re-check keyframes that interpolate below 0."],"exampleFix":"// before\n<Checkerboard gap={-4} />\n\n// after\n<Checkerboard gap={0} />\n\n// animated, clamped\n<Checkerboard gap={Math.max(0, interpolate(frame, [0, 30], [10, -2]))} />","handlingStrategy":"validation","validationCode":"const gap = Number(rawGap);\nif (!(Number.isFinite(gap) && gap >= 0)) {\n  throw new Error(`gap must be >= 0, got ${rawGap}`);\n}\n// then: <Checkerboard gap={gap} />","typeGuard":"const isNonNegativeNumber = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v >= 0;","tryCatchPattern":null,"preventionTips":["Clamp animated gap with Math.max(0, value).","Remember gap is the only checkerboard numeric allowed to be 0; cellSize is not.","Guard externally sourced gap values with isNonNegativeNumber before render."],"tags":["validation","checkerboard","effects","typescript","params"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}