{"record":{"id":"609ff97480c846f8","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s-609ff9","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/lines.ts","lineNumber":166,"sourceCode":"\t\toffset: p.offset ?? DEFAULT_OFFSET,\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":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/lines.ts#L148-L184","documentation":"Thrown by validatePositive() in the lines effect when `thickness` (after applying the default) is <= 0. Line thickness must be strictly positive because it determines the fragment shader's stroke width, so zero/negative values are rejected at setup. Note `gap` uses the separate validateNonNegative and allows 0.","triggerScenarios":"Calling lines({ thickness: 0 }) or with a negative thickness, or animating thickness and letting it reach/cross 0. Because the default is substituted before validation, passing `undefined` is safe — only an explicit <=0 number triggers it.","commonSituations":"Animators driving thickness to 0 to 'hide' the lines instead of unmounting the effect; copy-pasting a value from a different effect whose minimum is 0; off-by-one in interpolate output arrays; passing a value computed from a division that can yield 0.","solutions":["Set `thickness` to a positive number (e.g. >= 1); use the default by omitting the field.","When animating, clamp: Math.max(Number.EPSILON, interpolate({ input, range, output })) or conditionally unmount the effect when it should be invisible.","To hide the lines, remove the effect from the sequence rather than setting thickness to 0.","Double-check interpolate's `extrapolateLeft/Right` so the output never reaches 0."],"exampleFix":"// before\nlines({ colors: ['#000', '#fff'], thickness: interpolate({ input: frame, range: [0, 30], output: [0, 10] }) });\n\n// after — clamp to a tiny positive value, or unmount when it should be hidden\nconst thickness = Math.max(0.001, interpolate({ input: frame, range: [0, 30], output: [0.001, 10], extrapolateLeft: 'clamp', extrapolateRight: 'clamp' }));\nlines({ colors: ['#000', '#fff'], thickness });","handlingStrategy":"validation","validationCode":"import {interpolate} from 'remotion';\n\n// Thickness must stay strictly positive; clamp at a tiny epsilon or unmount to hide.\nconst safeThickness = (v: number) => Math.max(0.001, v);\n\nconst thickness = safeThickness(\n  interpolate({input: frame, range: [0, 30], output: [0.001, 10], extrapolateLeft: 'clamp', extrapolateRight: 'clamp'})\n);\nlines({colors: ['#000', '#fff'], thickness});","typeGuard":"const isValidThickness = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0;","tryCatchPattern":null,"preventionTips":["Keep `thickness` strictly positive; omit the field to use the default.","To hide the lines, unmount the effect instead of driving thickness to 0.","Clamp animated thickness with Math.max(Number.EPSILON, ...) and interpolate's clamp extrapolation.","Remember `gap` (validateNonNegative) allows 0, but `thickness` (validatePositive) does not."],"tags":["validation","typescript","params","argument","range"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}