remotion-dev/remotion · error · TypeError

The "durationInFrames" prop ${component} must be finite, but

Error message

The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.

What it means

`validateDurationInFrames` rejects non-finite (`Infinity`/`-Infinity`) durations. Note `<Series.Sequence>` intentionally allows `Infinity` for its last sequence and skips the validator in that case; everywhere else (notably `<Composition>`), an infinite duration throws.

Source

Thrown at packages/core/src/validation/validate-duration-in-frames.ts:32

		throw new Error(
			`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`,
		);
	}

	if (durationInFrames <= 0) {
		throw new TypeError(
			`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`,
		);
	}

	if (!allowFloats && durationInFrames % 1 !== 0) {
		throw new TypeError(
			`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`,
		);
	}

	if (!Number.isFinite(durationInFrames)) {
		throw new TypeError(
			`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`,
		);
	}
}

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Use a large but finite duration if you need near-unbounded playback.
  2. Ensure `calculateMetadata` returns a finite number.
  3. Reserve Infinity only for the last `<Series.Sequence>`.

Example fix

// before
<Composition durationInFrames={Infinity} ... />
// after
<Composition durationInFrames={Number.MAX_SAFE_INTEGER} ... /> // or a real finite value
Defensive patterns

Strategy: validation

Validate before calling

if (!Number.isFinite(d)) { throw new Error('duration must be finite'); }

Prevention

When it happens

Trigger: Setting `durationInFrames={Infinity}` on a `<Composition>`, or returning `Infinity` from its `calculateMetadata`; passing Infinity to `<Loop>` or to a non-final `<Series.Sequence>`.

Common situations: Using Infinity as a 'play forever' sentinel on a `<Composition>` (not supported); a metadata calculation that divides by zero or aggregates an empty set.

Related errors


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