{"record":{"id":"dc2fa6749021f8d5","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s-dc2fa6","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/waves.ts","lineNumber":211,"sourceCode":"\t\tphase: p.phase ?? DEFAULT_PHASE,\n\t\tmaskToSourceAlpha: p.maskToSourceAlpha ?? DEFAULT_MASK_TO_SOURCE_ALPHA,\n\t};\n};\n\nconst formatEnum = (variants: readonly string[]): string => {\n\tif (variants.length === 2) {\n\t\treturn `\"${variants[0]}\" or \"${variants[1]}\"`;\n\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","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/waves.ts#L193-L229","documentation":"Thrown by validatePositive() during waves() effect param validation. The waves effect requires thickness and wavelength to be strictly positive (> 0). This TypeError fires when either value resolves to 0 or a negative number 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:274 (validatePositive(thickness, 'thickness')) and line 277 (validatePositive(wavelength, 'wavelength')). Fires when you pass waves({thickness: 0}) or waves({thickness: -5}) or waves({wavelength: 0}) or waves({wavelength: -10}). Note defaults are thickness=40 and wavelength=160, so this only triggers when you explicitly pass a non-positive value.","commonSituations":"Passing thickness: 0 trying to make stripes invisible (use gap or remove the effect instead); animating wavelength toward 0 and hitting zero on a frame; passing negative values by mistake from a computed expression; confusing thickness with gap semantics.","solutions":["Set thickness to a small positive value (e.g., 0.1, the schema minimum) instead of 0.","If you want no visible stripes, remove the waves() effect from that frame's filter chain rather than zeroing thickness.","If animating, clamp the interpolated value with Math.max(0.1, value) before passing it.","For wavelength, use Math.max(1, value) since the schema minimum is 1."],"exampleFix":"// before\nimport {waves} from '@remotion/effects';\nwaves({thickness: 0})      // throws\nwaves({wavelength: 0})     // throws\n\n// after\nwaves({thickness: 0.1})   // thinnest allowed\nwaves({wavelength: 1})    // shortest allowed\n\n// animating with a safe clamp\nwaves({\n  thickness: Math.max(0.1, spring({frame, fps, config})),\n})","handlingStrategy":"validation","validationCode":"import type {WavesParams} from '@remotion/effects';\n\nconst validateWavesPositive = (params: WavesParams): void => {\n  if (params.thickness !== undefined && params.thickness <= 0) {\n    throw new Error(`thickness must be > 0, got ${params.thickness}`);\n  }\n  if (params.wavelength !== undefined && params.wavelength <= 0) {\n    throw new Error(`wavelength must be > 0, got ${params.wavelength}`);\n  }\n};\n\n// Run before calling waves()\nvalidateWavesPositive({thickness: myThickness, wavelength: myWavelength});","typeGuard":"const isPositiveNumber = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0;\n\nconst hasValidPositiveParams = (params: {\n  thickness?: number;\n  wavelength?: number;\n}): boolean =>\n  (params.thickness === undefined || isPositiveNumber(params.thickness)) &&\n  (params.wavelength === undefined || isPositiveNumber(params.wavelength));","tryCatchPattern":null,"preventionTips":["Clamp animated values: Math.max(0.1, thickness) and Math.max(1, wavelength).","Use the schema min values (0.1 for thickness, 1 for wavelength) as hard floors.","When interpolating, ensure the easing function never crosses zero."],"tags":["validation","waves-effect","typescript","params","typeerror"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}