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` (a TypeError) during `validateBurlapParams` when the resolved `size` value is <= 0. Burlap's `size` param controls weave-strand spacing in pixels and must be strictly positive; the default is 5. This is the only error in the set that is a direct user-input validation failure, raised before any GL work.

Source

Thrown at packages/effects/src/burlap.ts:113

	readonly uRoughness: WebGLUniformLocation | null;
	readonly uSeed: WebGLUniformLocation | null;
	readonly uColor: WebGLUniformLocation | null;
	readonly colorCtx: CanvasRenderingContext2D;
	cachedColor: string;
	cachedColorRgba: ParsedColorRgba;
};

const resolve = (p: BurlapParams): BurlapResolved => ({
	amount: p.amount ?? DEFAULT_AMOUNT,
	size: p.size ?? DEFAULT_SIZE,
	roughness: p.roughness ?? DEFAULT_ROUGHNESS,
	seed: p.seed ?? DEFAULT_SEED,
	color: p.color ?? DEFAULT_COLOR,
});

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 validateBurlapParams = (params: BurlapParams): void => {
	assertEffectParamsObject(params, 'Burlap');
	assertOptionalFiniteNumber(params.amount, 'amount');
	assertOptionalFiniteNumber(params.size, 'size');
	assertOptionalFiniteNumber(params.roughness, 'roughness');
	assertOptionalFiniteNumber(params.seed, 'seed');
	assertOptionalColor(params.color, 'color');

	const r = resolve(params);
	validateUnitInterval(r.amount, 'amount');
	validatePositive(r.size, 'size');
	validateUnitInterval(r.roughness, 'roughness');
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Pass a strictly positive `size` (e.g. the default 5, or any value in the documented 0.1–80 range).
  2. Clamp the dynamic value before passing: `size: Math.max(0.1, computedSize)`.
  3. Re-check that you are setting `size`, not `amount`; `amount` may be 0 but `size` may not.

Example fix

// before
burlap({size: 0});

// after
burlap({size: Math.max(0.1, computedSize)});
Defensive patterns

Strategy: validation

Validate before calling

function validBurlapSize(size: number | undefined): boolean {
  const s = size ?? 5; // default
  return Number.isFinite(s) && s > 0;
}
// before calling burlap:
if (!validBurlapSize(params.size)) { params = {...params, size: 5}; }

Type guard

function isPositiveSize(v: unknown): v is number {
  return typeof v === 'number' && Number.isFinite(v) && v > 0;
}

Prevention

When it happens

Trigger: Fires at line 112-116 when `validatePositive(r.size, 'size')` is called with a resolved size <= 0 (explicitly passed 0, a negative number, or -0). The amount/roughness unit-interval checks run before it.

Common situations: Passing `{size: 0}` or a negative size to the `burlap()` effect; computing size dynamically from a value that can hit zero (e.g. scaling by a fade that bottoms out); confusing size with amount (which allows 0).

Related errors


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