remotion-dev/remotion · error · TypeError

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

Error message

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

What it means

The noiseDisplacement() effect's optional `biasAmount` prop (directional pull multiplier relative to strength) must be non-negative. This TypeError fires after resolve() applies the default of 0. Note that biasAmount is also constrained to <= 1 via the schema, but the runtime check here only guards the lower bound.

Source

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

	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() {
	vUv = aUv;
	gl_Position = vec4(aPos, 0.0, 1.0);
}
`;

const NOISE_DISPLACEMENT_FS = /* glsl */ `#version 300 es
precision highp float;

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use a non-negative value: noiseDisplacement({ biasAmount: 0.5 }) or biasAmount: 0 to disable bias.
  2. To change bias direction, adjust biasDirection (in degrees) rather than using negative biasAmount.
  3. Clamp animated values: biasAmount: Math.max(0, interpolatedValue).
  4. Omit biasAmount to use the default of 0.

Example fix

// before
noiseDisplacement({ center: [0.5, 0.5], radius: 0.5, biasAmount: -0.3 })

// after
noiseDisplacement({ center: [0.5, 0.5], radius: 0.5, biasAmount: 0.3, biasDirection: 90 })
Defensive patterns

Strategy: validation

Validate before calling

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

Prevention

When it happens

Trigger: Calling noiseDisplacement({ biasAmount: -0.5 }) or any negative number for biasAmount. biasAmount: 0 is valid and disables directional bias.

Common situations: Animation interpolation going negative; sign errors; expecting negative biasAmount to reverse the bias direction (use biasDirection in degrees for directional control instead).

Related errors


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