{"record":{"id":"be32f9420b6d11c7","repo":"remotion-dev/remotion","slug":"name-must-be-greater-than-0-but-got-json-s-be32f9","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/shine.ts","lineNumber":107,"sourceCode":"\treadonly angle: number;\n\treadonly haloSigma: number;\n\treadonly coreSigma: number;\n\treadonly haloIntensity: number;\n\treadonly coreIntensity: number;\n};\n\nconst resolve = (p: ShineParams): ShineResolved => ({\n\tprogress: p.progress ?? DEFAULT_PROGRESS,\n\tangle: p.angle ?? DEFAULT_ANGLE,\n\thaloSigma: p.haloSigma ?? DEFAULT_HALO_SIGMA,\n\tcoreSigma: p.coreSigma ?? DEFAULT_CORE_SIGMA,\n\thaloIntensity: p.haloIntensity ?? DEFAULT_HALO_INTENSITY,\n\tcoreIntensity: p.coreIntensity ?? DEFAULT_CORE_INTENSITY,\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 validateShineParams = (params: ShineParams): void => {\n\tassertEffectParamsObject(params, 'Shine');\n\tassertOptionalFiniteNumber(params.progress, 'progress');\n\tassertOptionalFiniteNumber(params.angle, 'angle');\n\tassertOptionalFiniteNumber(params.haloSigma, 'haloSigma');\n\tassertOptionalFiniteNumber(params.coreSigma, 'coreSigma');\n\tassertOptionalFiniteNumber(params.haloIntensity, 'haloIntensity');\n\tassertOptionalFiniteNumber(params.coreIntensity, 'coreIntensity');\n\n\tconst r = resolve(params);\n\tvalidateUnitInterval(r.progress, 'progress');\n\tvalidatePositive(r.haloSigma, 'haloSigma');\n\tvalidatePositive(r.coreSigma, 'coreSigma');","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/shine.ts#L89-L125","documentation":"The shine() effect validates that haloSigma and coreSigma are strictly positive after applying defaults. The validatePositive helper throws this TypeError when the resolved value is <= 0. Defaults are 200 and 65 respectively, so this only fires when the caller explicitly passes zero or a negative number.","triggerScenarios":"Calling shine({ haloSigma: 0 }), shine({ coreSigma: -10 }), or shine({ haloSigma: 0, coreSigma: 0 }). Both parameters control Gaussian blur widths in pixels, so zero or negative widths are mathematically meaningless.","commonSituations":"Passing a parameterized value driven by an animation interpolation that hits zero at the boundaries; copy-pasting from a config that used a different scale; passing a value from user input without clamping; confusing haloSigma (which must be > 0) with haloIntensity (which allows 0).","solutions":["Ensure haloSigma and coreSigma are positive numbers (> 0); if animating, clamp the interpolated value with Math.max(epsilon, value).","If you want no blur at all, set haloIntensity/coreIntensity to 0 instead of setting sigma to 0.","Check the parameter type — NaN or Infinity will be caught earlier by assertOptionalFiniteNumber, but 0 and negatives reach this check."],"exampleFix":"// before — haloSigma hits 0 at the start of the interpolation\nshine({ haloSigma: interpolate(frame, [0, 30], [0, 200]) })\n\n// after — clamp to a small positive value\nshine({ haloSigma: Math.max(1, interpolate(frame, [0, 30], [0, 200])) })","handlingStrategy":"validation","validationCode":"// Validate shine parameters before calling the effect\nfunction safeShineParams(params: {\n  haloSigma?: number;\n  coreSigma?: number;\n  [k: string]: unknown;\n}) {\n  if (params.haloSigma !== undefined && params.haloSigma <= 0) {\n    throw new Error(`haloSigma must be > 0, got ${params.haloSigma}`);\n  }\n  if (params.coreSigma !== undefined && params.coreSigma <= 0) {\n    throw new Error(`coreSigma must be > 0, got ${params.coreSigma}`);\n  }\n  return params;\n}\n\n// Usage:\nconst params = safeShineParams({ haloSigma: 200, coreSigma: 65 });\nshine(params);","typeGuard":"const isPositiveNumber = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v > 0;\n\nconst isShineSigmaParams = (p: unknown): p is { haloSigma?: number; coreSigma?: number } => {\n  if (typeof p !== 'object' || p === null) return false;\n  const obj = p as Record<string, unknown>;\n  if (obj.haloSigma !== undefined && !isPositiveNumber(obj.haloSigma)) return false;\n  if (obj.coreSigma !== undefined && !isPositiveNumber(obj.coreSigma)) return false;\n  return true;\n};","tryCatchPattern":"try {\n  shine({ haloSigma: animatedValue });\n} catch (e) {\n  if (e instanceof TypeError && e.message.includes('must be greater than 0')) {\n    // Clamp and retry with a safe default\n    shine({ haloSigma: 1 });\n  } else {\n    throw e;\n  }\n}","preventionTips":["Always pass positive values (> 0) for haloSigma and coreSigma.","When animating sigma values, clamp the output: Math.max(1, interpolatedValue).","To disable blur, set intensity to 0 rather than sigma to 0.","Use TypeScript types to catch accidental non-number or negative values at compile time."],"tags":["validation","typescript","shine","parameters"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}