remotion-dev/remotion · error · TypeError

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

Error message

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

What it means

The noiseDisplacement() effect's optional `blur` prop (additional local blur in pixels) must be non-negative. This TypeError fires when an explicitly negative blur is provided, after resolve() applies the default of 0. Blur adds a softening effect to the displaced samples.

Source

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

	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)}`,
		);
	}
};

const NOISE_DISPLACEMENT_VS = /* glsl */ `#version 300 es
in vec2 aPos;
in vec2 aUv;
out vec2 vUv;

void main() {

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use a non-negative value: noiseDisplacement({ blur: 2 }) or blur: 0 for no blur.
  2. Clamp animated values: blur: Math.max(0, interpolatedValue).
  3. Omit blur to use the default of 0.

Example fix

// before
noiseDisplacement({ center: [0.5, 0.5], radius: 0.5, blur: -3 })

// after
noiseDisplacement({ center: [0.5, 0.5], radius: 0.5, blur: 3 })
Defensive patterns

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: Calling noiseDisplacement({ blur: -5 }) or any negative number for blur. blur: 0 is valid and is the default.

Common situations: Animation interpolation crossing zero into negatives; sign errors in computed values; misunderstanding blur as a directional parameter.

Related errors


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