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

Thrown by validatePositive() during checkerboard parameter validation when a numeric prop that must be strictly positive is <= 0. In the shipped validator this is applied to cellSize (the square size in pixels). It is a TypeError raised before any GL work, so it indicates bad input from the composition author, not a GPU problem.

Source

Thrown at packages/effects/src/checkerboard.ts:148

const resolve = (p: CheckerboardParams): CheckerboardResolved => {
	const cellSize = p.cellSize ?? DEFAULT_CELL_SIZE;
	const gap = p.gap ?? DEFAULT_GAP;

	return {
		colors: p.colors ?? DEFAULT_COLORS,
		cellSize,
		spacing: cellSize + gap,
		angle: p.angle ?? DEFAULT_ANGLE,
		offsetX: p.offsetX ?? DEFAULT_OFFSET_X,
		offsetY: p.offsetY ?? DEFAULT_OFFSET_Y,
		maskToSourceAlpha: p.maskToSourceAlpha ?? DEFAULT_MASK_TO_SOURCE_ALPHA,
	};
};

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 validateNonNegative = (value: number, name: string): void => {
	if (value < 0) {
		throw new TypeError(
			`"${name}" must be greater than or equal to 0, but got ${JSON.stringify(value)}`,
		);
	}
};

const validateColors = (colors: unknown): void => {
	if (colors === undefined) {
		return;
	}

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Set cellSize to a positive number (schema min is 0.1, e.g. 80).
  2. Clamp any animated cellSize with Math.max(0.1, value) before passing it.
  3. If you intended no checker cells, remove the effect instead of zeroing cellSize.
  4. Re-check keyframes that interpolate toward 0.

Example fix

// before
<Checkerboard cellSize={0} />

// after
<Checkerboard cellSize={80} />

// animated, clamped
<Checkerboard cellSize={Math.max(10, interpolate(frame, [0, 30], [80, 0]))} />
Defensive patterns

Strategy: validation

Validate before calling

// Validate cellSize BEFORE passing it to <Checkerboard />.
const cellSize = Number(rawCellSize);
if (!(Number.isFinite(cellSize) && cellSize > 0)) {
  throw new Error(`cellSize must be > 0, got ${rawCellSize}`);
}
// then: <Checkerboard cellSize={cellSize} />

Type guard

const isPositiveNumber = (v: unknown): v is number =>
  typeof v === 'number' && Number.isFinite(v) && v > 0;

Prevention

When it happens

Trigger: Passing <Checkerboard cellSize={0} />, cellSize={-5}, or a keyframed cellSize that crosses zero; validateCheckerboardParams() resolves cellSize and calls validatePositive(cellSize,'cellSize') which throws at checkerboard.ts:148 because value <= 0.

Common situations: Typo in a keyframe value, animating cellSize down to 0, passing a 0 from a dynamic data source, or confusing cellSize (must be > 0) with gap (allowed 0).

Related errors


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