remotion-dev/remotion · error · RangeError

The "${name}" prop of ${componentName} must be between 0 and

Error message

The "${name}" prop of ${componentName} must be between 0 and 1, but got ${value}.

What it means

After confirming the crop value is a finite number, validateSequenceCrop requires it within [0,1] because crop values represent a fraction of the frame dimension to crop. Values below 0 or above 1 are meaningless and throw a RangeError.

Source

Thrown at packages/core/src/sequence-crop.ts:99

};

export const validateSequenceCrop = (
	crop: SequenceCropInput,
	componentName = '<Sequence />',
): void => {
	for (const [name, value] of Object.entries(crop)) {
		if (value === undefined) {
			continue;
		}

		if (typeof value !== 'number' || !Number.isFinite(value)) {
			throw new TypeError(
				`The "${name}" prop of ${componentName} must be a finite number, but got ${String(value)}.`,
			);
		}

		if (value < 0 || value > 1) {
			throw new RangeError(
				`The "${name}" prop of ${componentName} must be between 0 and 1, but got ${value}.`,
			);
		}
	}
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use fractions between 0 and 1: crop={{left: 0.25}}.
  2. Convert pixels to a fraction: leftPx / frameWidth.

Example fix

// before
crop={{left: 100}}
// after
crop={{left: 100 / width}}
Defensive patterns

Strategy: validation

Validate before calling

function clamp01(c) {
  const out = {};
  for (const [k, v] of Object.entries(c)) {
    if (v === undefined) continue;
    out[k] = Math.min(1, Math.max(0, v));
  }
  return out;
}

Type guard

const isCropFraction = (v: unknown): v is number =>
  typeof v === 'number' && Number.isFinite(v) && v >= 0 && v <= 1;

Prevention

When it happens

Trigger: crop={{left: 1.5}}, crop={{top: -0.2}}, crop={{right: 2}}, crop={{left: 100}} (confusing pixels/fractions).

Common situations: Confusing the 0–1 fraction with pixel values or with a 0–100 percentage; passing raw pixel measurements.

Related errors


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