remotion-dev/remotion · error · TypeError

"${name}" must be > 0

Error message

"${name}" must be > 0

What it means

validatePositive throws when a pattern() prop that must be strictly greater than zero (notably 'scale') resolves to zero or a negative number. This protects the shader's tiling division from divide-by-zero / sign-flip artifacts.

Source

Thrown at packages/effects/src/pattern.ts:249

		throw new TypeError(`"${name}" must be a [number, number] tuple`);
	}
};

const assertOptionalInteger = (value: unknown, name: string): void => {
	if (value === undefined) {
		return;
	}

	if (!Number.isInteger(value)) {
		throw new TypeError(
			`"${name}" must be an integer, but got ${JSON.stringify(value)}`,
		);
	}
};

const validatePositive = (value: number, name: string): void => {
	if (value <= 0) {
		throw new TypeError(`"${name}" must be > 0`);
	}
};

const validateAtLeast = (value: number, min: number, name: string): void => {
	if (value < min) {
		throw new TypeError(
			`"${name}" must be >= ${min}, but got ${JSON.stringify(value)}`,
		);
	}
};

const validatePatternParams = (params: PatternParams): void => {
	assertEffectParamsObject(params, 'Pattern');
	assertOptionalFiniteNumber(params.scale, 'scale');
	assertOptionalFiniteNumber(params.cropLeft, 'cropLeft');
	assertOptionalFiniteNumber(params.cropTop, 'cropTop');
	assertOptionalFiniteNumber(params.cropRight, 'cropRight');
	assertOptionalFiniteNumber(params.cropBottom, 'cropBottom');

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Keep scale strictly positive; the schema default is 0.1 with min 0.001.
  2. Clamp animated scale to a small positive floor, e.g. Math.max(0.001, value).
  3. To fade the effect out, animate opacity/amount rather than driving scale to zero.

Example fix

// before
pattern({ scale: animatedScale }) // animatedScale hits 0

// after
pattern({ scale: Math.max(0.001, animatedScale) })
Defensive patterns

Strategy: validation

Validate before calling

// Keep scale strictly positive.
const scale = animatedScale <= 0 ? 0.001 : animatedScale;
pattern({ scale });

Type guard

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

Prevention

When it happens

Trigger: Calling pattern({ scale: 0 }) or pattern({ scale: -0.1 }), or animating scale down to/below zero. The check runs on the resolved value in validatePatternParams after defaults are applied.

Common situations: Animating scale toward zero to 'hide' the pattern; passing a negative scale to mirror (not supported); computing scale from a ratio that hits zero at the boundary frames.

Related errors


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