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

validatePositive throws this TypeError when a noiseDisplacement parameter that must be strictly positive is zero or negative. It is applied to `radius` (line 239), `grainSize` (line 247), and `passes` (line 248) after defaults are resolved. The parameter name is interpolated into the message so you can identify which one failed.

Source

Thrown at packages/effects/src/noise-displacement.ts:206

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

const assertOptionalIntegerNumber = (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 greater than 0, but got ${JSON.stringify(value)}`,
		);
	}
};

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

const validateNoiseDisplacementParams = (
	params: NoiseDisplacementParams,
): void => {
	assertEffectParamsObject(params, 'Noise Displacement');
	assertRequiredUvCoordinate(params.center, 'center');

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use a positive value: radius must be > 0 and <= 1, grainSize must be > 0, passes must be > 0 and <= 12.
  2. To disable the displacement effect, set strength: 0 rather than radius: 0.
  3. Clamp computed values: radius: Math.max(0.001, computedRadius).
  4. Check the error message to see which named parameter failed.

Example fix

// before
noiseDisplacement({ center: [0.5, 0.5], radius: 0, strength: 36 })

// after
noiseDisplacement({ center: [0.5, 0.5], radius: 0.5, strength: 36 })
// to disable the effect visually, use strength: 0
noiseDisplacement({ center: [0.5, 0.5], radius: 0.5, strength: 0 })
Defensive patterns

Strategy: validation

Validate before calling

// Validate positive params before calling noiseDisplacement()
if (params.radius !== undefined && params.radius <= 0) {
  throw new Error(`radius must be > 0, got ${params.radius}`);
}
if (params.grainSize !== undefined && params.grainSize <= 0) {
  throw new Error(`grainSize must be > 0, got ${params.grainSize}`);
}
if (params.passes !== undefined && params.passes <= 0) {
  throw new Error(`passes must be > 0, got ${params.passes}`);
}
const result = noiseDisplacement(params);

Prevention

When it happens

Trigger: Calling noiseDisplacement with radius <= 0 (e.g. radius: 0 or radius: -0.5), grainSize <= 0 (after default resolution), or passes <= 0 (e.g. passes: 0). These are checked after resolve() applies defaults, so even omitted grainSize/passess that resolve to non-positive values would trigger it — but the defaults (8 and 6) are positive.

Common situations: Setting radius to 0 thinking it disables the effect (it doesn't — use strength: 0 instead); passing a computed radius that can go to zero or negative; animation interpolation that hits zero at the boundary; grainSize set to 0 expecting no grain.

Related errors


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