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

  1. Ensure haloSigma and coreSigma are positive numbers (> 0); if animating, clamp the interpolated value with Math.max(epsilon, value).
  2. If you want no blur at all, set haloIntensity/coreIntensity to 0 instead of setting sigma to 0.
  3. 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

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


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/be32f9420b6d11c7. Report an issue: GitHub.