{"record":{"id":"daf0935359a6aa02","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s-daf093","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/emboss.ts","lineNumber":135,"sourceCode":"\t\treadonly uAngle: WebGLUniformLocation | null;\n\t\treadonly uLightAngle: WebGLUniformLocation | null;\n\t\treadonly uOffset: WebGLUniformLocation | null;\n\t};\n};\n\nconst resolve = (p: EmbossParams): EmbossResolved => ({\n\tamount: p.amount ?? DEFAULT_AMOUNT,\n\tsize: p.size ?? DEFAULT_SIZE,\n\tlineWidth: p.lineWidth ?? DEFAULT_LINE_WIDTH,\n\tdepth: p.depth ?? DEFAULT_DEPTH,\n\tangle: p.angle ?? DEFAULT_ANGLE,\n\tlightAngle: p.lightAngle ?? DEFAULT_LIGHT_ANGLE,\n\toffset: p.offset ?? DEFAULT_OFFSET,\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 validateEmbossParams = (params: EmbossParams): void => {\n\tassertEffectParamsObject(params, 'Emboss');\n\tassertOptionalFiniteNumber(params.amount, 'amount');\n\tassertOptionalFiniteNumber(params.size, 'size');\n\tassertOptionalFiniteNumber(params.lineWidth, 'lineWidth');\n\tassertOptionalFiniteNumber(params.depth, 'depth');\n\tassertOptionalFiniteNumber(params.angle, 'angle');\n\tassertOptionalFiniteNumber(params.lightAngle, 'lightAngle');\n\tassertOptionalFiniteNumber(params.offset, 'offset');\n\n\tconst r = resolve(params);\n\tvalidateUnitInterval(r.amount, 'amount');\n\tvalidatePositive(r.size, 'size');","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/emboss.ts#L117-L153","documentation":"Thrown by the emboss effect's internal validatePositive() (a TypeError) when a resolved `size` or `lineWidth` is <= 0. validateEmbossParams() calls validatePositive only on size and lineWidth after assertOptionalFiniteNumber has already guaranteed they are finite numbers. The relief pattern math requires strictly positive cell/dash dimensions, so zero or negative values are rejected up front.","triggerScenarios":"Calling emboss({size: 0}), emboss({size: -5}), emboss({lineWidth: 0}), or emboss({lineWidth: -1}). Also when a param is driven by an interpolate() or formula that crosses zero at some frame.","commonSituations":"Animating `size` or `lineWidth` through 0, deriving the value from a ratio that can hit zero, or a copy-paste typo. Note the schema documents size min=1 and lineWidth min=0.1, so values below those are out of the supported range.","solutions":["Pass a strictly positive value: keep size >= 1 and lineWidth >= 0.1 per the emboss schema.","When animating, clamp with a floor, e.g. interpolate(...) then Math.max(1, size).","If the value is computed, validate it before passing it to emboss().","Leave the prop undefined to use the documented defaults (size 26, lineWidth 7)."],"exampleFix":"// before\nemboss({size: frame > 30 ? 0 : 26})\n\n// after\nemboss({size: frame > 30 ? 1 : 26})","handlingStrategy":"validation","validationCode":"// Validate size/lineWidth before calling emboss().\nfunction isPositiveFinite(v: unknown): v is number {\n  return typeof v === 'number' && Number.isFinite(v) && v > 0;\n}\n\nfunction resolveEmbossDims(p: {size?: number; lineWidth?: number}) {\n  const size = p.size ?? 26;\n  const lineWidth = p.lineWidth ?? 7;\n  if (!isPositiveFinite(size)) throw new TypeError(`size must be > 0, got ${size}`);\n  if (!isPositiveFinite(lineWidth)) throw new TypeError(`lineWidth must be > 0, got ${lineWidth}`);\n  return {size, lineWidth};\n}","typeGuard":"function isValidEmbossPositive(v: unknown): v is number {\n  return typeof v === 'number' && Number.isFinite(v) && v > 0;\n}","tryCatchPattern":null,"preventionTips":["Keep size >= 1 and lineWidth >= 0.1 (the emboss schema's documented minimums).","When animating size/lineWidth, clamp with a floor: Math.max(1, value) / Math.max(0.1, value).","Type props so the compiler warns on out-of-range literals.","Omit the prop to use the safe defaults (size 26, lineWidth 7)."],"tags":["validation","typescript","effects","params"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}