{"record":{"id":"3a1857927ba8e3e2","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-or-equal-to-0-but-3a1857","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":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/waves.ts","lineNumber":219,"sourceCode":"\t}\n\n\treturn `${variants\n\t\t.slice(0, -1)\n\t\t.map((variant) => `\"${variant}\"`)\n\t\t.join(', ')} or \"${variants[variants.length - 1]}\"`;\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":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/waves.ts#L201-L237","documentation":"Thrown by validateNonNegative() during waves() effect param validation. The waves effect requires gap and amplitude to be non-negative (>= 0). This TypeError fires when either value is negative after applying defaults. The error message names which field is invalid and shows the offending value.","triggerScenarios":"Called from validateWavesParams() at packages/effects/src/waves.ts:275 (validateNonNegative(gap, 'gap')) and line 276 (validateNonNegative(amplitude, 'amplitude')). Fires when you pass waves({gap: -1}) or waves({amplitude: -5}). Defaults are gap=0 and amplitude=24, so this only triggers on explicit negative values.","commonSituations":"Passing a negative gap or amplitude from an animation expression that overshoots below zero; accidentally using a signed offset value for gap; interpolating amplitude through a negative range during a spring/easing overshoot.","solutions":["Clamp the animated value with Math.max(0, value) before passing it.","Use waves({gap: 0}) instead of a negative value if you want no gap.","Use waves({amplitude: 0}) for a flat (non-wavy) stripe pattern.","Check that easing/spring configs don't overshoot into negative territory for these params."],"exampleFix":"// before\nimport {waves} from '@remotion/effects';\nwaves({gap: -10})       // throws\nwaves({amplitude: -5})  // throws\n\n// after\nwaves({gap: 0})         // no gap\nwaves({amplitude: 0})   // flat stripes\n\n// animating with a safe clamp\nwaves({\n  amplitude: Math.max(0, interpolate(frame, [0, 30], [0, 50])),\n})","handlingStrategy":"validation","validationCode":"import type {WavesParams} from '@remotion/effects';\n\nconst validateWavesNonNegative = (params: WavesParams): void => {\n  if (params.gap !== undefined && params.gap < 0) {\n    throw new Error(`gap must be >= 0, got ${params.gap}`);\n  }\n  if (params.amplitude !== undefined && params.amplitude < 0) {\n    throw new Error(`amplitude must be >= 0, got ${params.amplitude}`);\n  }\n};\n\nvalidateWavesNonNegative({gap: myGap, amplitude: myAmplitude});","typeGuard":"const isNonNegativeNumber = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v >= 0;\n\nconst hasValidNonNegativeParams = (params: {\n  gap?: number;\n  amplitude?: number;\n}): boolean =>\n  (params.gap === undefined || isNonNegativeNumber(params.gap)) &&\n  (params.amplitude === undefined || isNonNegativeNumber(params.amplitude));","tryCatchPattern":null,"preventionTips":["Clamp animated values: Math.max(0, gap) and Math.max(0, amplitude).","Check that spring/easing overshoots don't produce negative values.","Use 0 explicitly for 'none' rather than negative values."],"tags":["validation","waves-effect","typescript","params","typeerror"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}