{"record":{"id":"9204898785f5b483","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s-920489","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/contour-lines.ts","lineNumber":197,"sourceCode":"};\n\nconst resolve = (p: ContourLinesParams): ContourLinesResolved => ({\n\tlineColor: p.lineColor ?? DEFAULT_LINE_COLOR,\n\tlineWidth: p.lineWidth ?? DEFAULT_LINE_WIDTH,\n\tspacing: p.spacing ?? DEFAULT_SPACING,\n\tscale: p.scale ?? DEFAULT_SCALE,\n\tcomplexity: p.complexity ?? DEFAULT_COMPLEXITY,\n\tsmoothness: p.smoothness ?? DEFAULT_SMOOTHNESS,\n\tseed: p.seed ?? DEFAULT_SEED,\n\toffsetX: p.offsetX ?? DEFAULT_OFFSET_X,\n\toffsetY: p.offsetY ?? DEFAULT_OFFSET_Y,\n\topacity: p.opacity ?? DEFAULT_OPACITY,\n\tmaskToSourceAlpha: p.maskToSourceAlpha ?? DEFAULT_MASK_TO_SOURCE_ALPHA,\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 validateContourLinesParams = (params: ContourLinesParams): void => {\n\tassertEffectParamsObject(params, 'Contour lines');\n\tassertOptionalColor(params.lineColor, 'lineColor');\n\tassertOptionalFiniteNumber(params.lineWidth, 'lineWidth');\n\tassertOptionalFiniteNumber(params.spacing, 'spacing');\n\tassertOptionalFiniteNumber(params.scale, 'scale');\n\tassertOptionalFiniteNumber(params.complexity, 'complexity');\n\tassertOptionalFiniteNumber(params.smoothness, 'smoothness');\n\tassertOptionalFiniteNumber(params.seed, 'seed');\n\tassertOptionalFiniteNumber(params.offsetX, 'offsetX');\n\tassertOptionalFiniteNumber(params.offsetY, 'offsetY');\n\tassertOptionalFiniteNumber(params.opacity, 'opacity');\n\tassertOptionalBoolean(params.maskToSourceAlpha, 'maskToSourceAlpha');","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/contour-lines.ts#L179-L215","documentation":"Thrown by the local validatePositive helper in contour-lines.ts when a resolved contour-lines parameter that must be strictly greater than 0 is given a zero or negative value. This applies to lineWidth, spacing, and scale after defaults are resolved. A value of exactly 0 is rejected (not just negatives), because zero-width lines, zero spacing, or zero scale would produce a degenerate invisible result.","triggerScenarios":"Calling contourLines({lineWidth: 0}), contourLines({spacing: 0}), contourLines({scale: 0}), contourLines({lineWidth: -1}), contourLines({spacing: -5}), or contourLines({scale: 0.0001}) where the value rounds to or hits zero. Also triggered by interpolate() animating one of these params through zero.","commonSituations":"Animating lineWidth or spacing to fade the effect in/out by going to zero (use opacity instead); passing a computed scale factor that collapses to zero at certain frames; defaulting a parameter to 0 expecting it to mean 'disabled'; dividing by a large number producing a sub-normal result that resolves to 0.","solutions":["Ensure lineWidth, spacing, and scale are always > 0 — use a small positive floor like 0.001 instead of 0.","To fade the contour lines effect in/out, animate the opacity parameter (valid range 0..1) rather than driving lineWidth or scale to zero.","Clamp computed values: Math.max(0.001, value) before passing to contourLines().","If animating with interpolate(), set the outputRange floor above zero."],"exampleFix":"// before (lineWidth animates through 0, throwing)\ncontourLines({lineWidth: interpolate(frame, [0, 30], [0, 2])})\n\n// after (use opacity for fade, keep lineWidth positive)\ncontourLines({\n  lineWidth: interpolate(frame, [0, 30], [0.01, 2]),\n  opacity: interpolate(frame, [0, 30], [0, 1], {extrapolateLeft: 'clamp'}),\n})","handlingStrategy":"validation","validationCode":"// Ensure strictly positive values for lineWidth, spacing, scale\nconst lineWidth = Math.max(0.001, computedLineWidth);\nconst spacing = Math.max(0.001, computedSpacing);\nconst scale = Math.max(0.001, computedScale);\ncontourLines({lineWidth, spacing, scale});","typeGuard":"const isStrictlyPositive = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0;","tryCatchPattern":null,"preventionTips":["Animate opacity (0..1) to fade contour lines, never lineWidth/spacing/scale.","Use a small positive floor (e.g. 0.001) instead of 0 for positive params.","Clamp interpolate() outputRange above zero for lineWidth, spacing, scale.","Remember that 0 is rejected, not just negatives."],"tags":["validation","effects","input-validation","contour-lines","webgl"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}