remotion-dev/remotion · error · TypeError

The "durationInFrames" prop ${component} must be an integer,

Error message

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

What it means

`validateDurationInFrames` requires an integer duration when `allowFloats` is false. `<Composition>` resolves durations with `allowFloats:false`, so a fractional `durationInFrames` throws. Note `<Series.Sequence>` uses `allowFloats:true`, so this specific message primarily comes from `<Composition>`/config resolution.

Source

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

	const {allowFloats, component} = options;
	if (typeof durationInFrames === 'undefined') {
		throw new Error(`The "durationInFrames" prop ${component} is missing.`);
	}

	if (typeof durationInFrames !== 'number') {
		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. Round to a whole frame: `Math.round(seconds * fps)`.
  2. Validate `Number.isInteger()` before assigning.
  3. Choose durations that divide evenly with fps.

Example fix

// before
const durationInFrames = seconds * fps; // e.g. 2.5 * 30 = 75 (ok), 1.1 * 30 = 33 (ok)... but 1.05*30=31.5 -> throws
<Composition durationInFrames={durationInFrames} ... />
// after
const durationInFrames = Math.round(seconds * fps);
<Composition durationInFrames={durationInFrames} ... />
Defensive patterns

Strategy: validation

Validate before calling

if (d % 1 !== 0) { throw new Error('duration must be an integer'); }

Prevention

When it happens

Trigger: Passing a fractional `durationInFrames` (e.g. `1.5`, `100.25`) to a `<Composition>`, or returning a fractional duration from `calculateMetadata` for a composition.

Common situations: Computing duration from seconds × fps where the product is not a whole number (`Math.ceil(seconds * fps)` left unrounded, or `seconds * 30` yielding a float); an aspect/sample-rate derived duration.

Related errors


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