remotion-dev/remotion · error · TypeError

"strength" must be >= 0, but got ${JSON.stringify(r.strength

Error message

"strength" must be >= 0, but got ${JSON.stringify(r.strength)}

What it means

The noiseDisplacement() effect's optional `strength` prop (maximum displacement in pixels at the center) must be non-negative. This TypeError is thrown after resolve() applies the default of 36, so it fires only when an explicitly negative strength is provided. Strength controls how far pixels are displaced.

Source

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

	assertRequiredUvCoordinate(params.center, 'center');
	assertRequiredFiniteNumber(params.radius, 'radius');
	assertOptionalFiniteNumber(params.strength, 'strength');
	assertOptionalFiniteNumber(params.seed, 'seed');
	assertOptionalFiniteNumber(params.grainSize, 'grainSize');
	assertOptionalFiniteNumber(params.passes, 'passes');
	assertOptionalIntegerNumber(params.passes, 'passes');
	assertOptionalFiniteNumber(params.blur, 'blur');
	assertOptionalFiniteNumber(params.feather, 'feather');
	assertOptionalFiniteNumber(params.biasDirection, 'biasDirection');
	assertOptionalFiniteNumber(params.biasAmount, 'biasAmount');

	const r = resolve(params);
	validateUnitInterval(r.center[0], 'center[0]');
	validateUnitInterval(r.center[1], 'center[1]');
	validatePositive(r.radius, 'radius');
	validateUnitInterval(r.radius, 'radius');
	if (r.strength < 0) {
		throw new TypeError(
			`"strength" must be >= 0, but got ${JSON.stringify(r.strength)}`,
		);
	}

	validatePositive(r.grainSize, 'grainSize');
	validatePositive(r.passes, 'passes');
	validateMax(r.passes, MAX_PASSES, 'passes');
	if (r.blur < 0) {
		throw new TypeError(
			`"blur" must be >= 0, but got ${JSON.stringify(r.blur)}`,
		);
	}

	validateUnitInterval(r.feather, 'feather');
	if (r.biasAmount < 0) {
		throw new TypeError(
			`"biasAmount" must be >= 0, but got ${JSON.stringify(r.biasAmount)}`,
		);

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use a non-negative value: noiseDisplacement({ strength: 36 }) or strength: 0 to disable.
  2. Clamp animated values: strength: Math.max(0, interpolatedValue).
  3. For directional control, use biasDirection and biasAmount instead of negative strength.
  4. Omit strength to use the default of 36.

Example fix

// before
noiseDisplacement({ center: [0.5, 0.5], radius: 0.5, strength: -10 })

// after
noiseDisplacement({ center: [0.5, 0.5], radius: 0.5, strength: 10 })
// to disable: strength: 0
Defensive patterns

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: Calling noiseDisplacement({ strength: -10 }) or any negative number for strength. Note: strength: 0 is valid and effectively disables the displacement.

Common situations: Animation interpolation that dips below zero; negating a value by mistake; thinking negative strength reverses the displacement direction (it doesn't — use biasDirection/biasAmount for directional control).

Related errors


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