remotion-dev/remotion · error · Error

The "durationInFrames" prop ${component} is missing.

Error message

The "durationInFrames" prop ${component} is missing.

What it means

`validateDurationInFrames` requires a `durationInFrames` value to be present. `undefined` throws 'is missing' before any type/range checks. It runs for `<Composition>`, `<Series.Sequence>`, and `<Loop>` (and during config resolution), with the `component` string identifying which one.

Source

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

export function validateDurationInFrames(
	durationInFrames: unknown,
	options: {
		component: string;
		allowFloats: boolean;
	},
): asserts durationInFrames is number {
	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}.`,
		);

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Add `durationInFrames={N}` to the component.
  2. If duration is dynamic, ensure `calculateMetadata` returns `durationInFrames`.
  3. Provide a sensible default rather than leaving it undefined.

Example fix

// before
<Composition id="x" component={X} fps={30} width={1920} height={1080} />
// after
<Composition id="x" component={X} fps={30} width={1920} height={1080} durationInFrames={150} />
Defensive patterns

Strategy: validation

Validate before calling

if (durationInFrames === undefined) {
  throw new Error('durationInFrames is required');
}

Type guard

const hasDuration = (d) => d !== undefined && d !== null;

Prevention

When it happens

Trigger: Omitting `durationInFrames` on a `<Composition>`, `<Series.Sequence>`, or `<Loop>` where no `calculateMetadata` supplies it; or a `calculateMetadata` that returns an object lacking the key.

Common situations: Forgetting the prop while relying on metadata that does not return it; a metadata function that throws or short-circuits before setting duration; copy-paste from a still (which has no duration).

Related errors


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