remotion-dev/remotion · error · TypeError
"${name}" must be greater than 0, but got ${JSON.stringify(v
Error message
"${name}" must be greater than 0, but got ${JSON.stringify(value)} What it means
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.
Source
Thrown at packages/effects/src/shine.ts:107
readonly angle: number;
readonly haloSigma: number;
readonly coreSigma: number;
readonly haloIntensity: number;
readonly coreIntensity: number;
};
const resolve = (p: ShineParams): ShineResolved => ({
progress: p.progress ?? DEFAULT_PROGRESS,
angle: p.angle ?? DEFAULT_ANGLE,
haloSigma: p.haloSigma ?? DEFAULT_HALO_SIGMA,
coreSigma: p.coreSigma ?? DEFAULT_CORE_SIGMA,
haloIntensity: p.haloIntensity ?? DEFAULT_HALO_INTENSITY,
coreIntensity: p.coreIntensity ?? DEFAULT_CORE_INTENSITY,
});
const validatePositive = (value: number, name: string): void => {
if (value <= 0) {
throw new TypeError(
`"${name}" must be greater than 0, but got ${JSON.stringify(value)}`,
);
}
};
const validateShineParams = (params: ShineParams): void => {
assertEffectParamsObject(params, 'Shine');
assertOptionalFiniteNumber(params.progress, 'progress');
assertOptionalFiniteNumber(params.angle, 'angle');
assertOptionalFiniteNumber(params.haloSigma, 'haloSigma');
assertOptionalFiniteNumber(params.coreSigma, 'coreSigma');
assertOptionalFiniteNumber(params.haloIntensity, 'haloIntensity');
assertOptionalFiniteNumber(params.coreIntensity, 'coreIntensity');
const r = resolve(params);
validateUnitInterval(r.progress, 'progress');
validatePositive(r.haloSigma, 'haloSigma');
validatePositive(r.coreSigma, 'coreSigma');View on GitHub (pinned to 78fe4bb3fd)
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.
Example fix
// before — haloSigma hits 0 at the start of the interpolation
shine({ haloSigma: interpolate(frame, [0, 30], [0, 200]) })
// after — clamp to a small positive value
shine({ haloSigma: Math.max(1, interpolate(frame, [0, 30], [0, 200])) }) Defensive patterns
Strategy: validation
Validate before calling
// Validate shine parameters before calling the effect
function safeShineParams(params: {
haloSigma?: number;
coreSigma?: number;
[k: string]: unknown;
}) {
if (params.haloSigma !== undefined && params.haloSigma <= 0) {
throw new Error(`haloSigma must be > 0, got ${params.haloSigma}`);
}
if (params.coreSigma !== undefined && params.coreSigma <= 0) {
throw new Error(`coreSigma must be > 0, got ${params.coreSigma}`);
}
return params;
}
// Usage:
const params = safeShineParams({ haloSigma: 200, coreSigma: 65 });
shine(params); Type guard
const isPositiveNumber = (v: unknown): v is number =>
typeof v === 'number' && Number.isFinite(v) && v > 0;
const isShineSigmaParams = (p: unknown): p is { haloSigma?: number; coreSigma?: number } => {
if (typeof p !== 'object' || p === null) return false;
const obj = p as Record<string, unknown>;
if (obj.haloSigma !== undefined && !isPositiveNumber(obj.haloSigma)) return false;
if (obj.coreSigma !== undefined && !isPositiveNumber(obj.coreSigma)) return false;
return true;
}; Try / catch
try {
shine({ haloSigma: animatedValue });
} catch (e) {
if (e instanceof TypeError && e.message.includes('must be greater than 0')) {
// Clamp and retry with a safe default
shine({ haloSigma: 1 });
} else {
throw e;
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- "${name}" must be a [number, number] tuple
- "${name}" must be between 0 and 1, but got ${JSON.stringify(
- "${name}" must be greater than -${MAX_ABSOLUTE_ANGLE} and le
- Starburst effect requires a parameters object, but got ${JSO
- "rays" must be a finite number, but got ${JSON.stringify(ray
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/be32f9420b6d11c7.
Report an issue: GitHub.