remotion-dev/remotion · error · TypeError

The "offset" property of a <Series.Sequence /> must not be N

Error message

The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).

What it means

The optional `offset` prop of <Series.Sequence> (a gap/overlap in frames between sequences) defaults to 0 via `offsetProp ?? 0`. If explicitly NaN, it throws because NaN propagates through the start-frame arithmetic and would silently corrupt the series layout.

Source

Thrown at packages/core/src/series/index.tsx:125

	index,
	childrenLength,
}: {
	readonly durationInFrames: number;
	readonly offset: number | undefined;
	readonly index: number;
	readonly childrenLength: number;
}) => {
	const debugInfo = `index = ${index}, duration = ${durationInFrames}`;
	if (index !== childrenLength - 1 || durationInFrames !== Infinity) {
		validateDurationInFrames(durationInFrames, {
			component: `of a <Series.Sequence /> component`,
			allowFloats: true,
		});
	}

	const offset = offsetProp ?? 0;
	if (Number.isNaN(offset)) {
		throw new TypeError(
			`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`,
		);
	}

	if (!Number.isFinite(offset)) {
		throw new TypeError(
			`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`,
		);
	}

	if (offset % 1 !== 0) {
		throw new TypeError(
			`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`,
		);
	}

	return offset;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Omit offset to use the default of 0 rather than passing NaN.
  2. Sanitize before passing: offset={Number.isFinite(v) ? v : undefined}.
  3. Fix the upstream calculation so it never yields NaN.

Example fix

// before
<Series.Sequence offset={parseInt(userVal)} />
// after
<Series.Sequence offset={Number.isFinite(parseInt(userVal)) ? parseInt(userVal) : undefined} />
Defensive patterns

Strategy: validation

Validate before calling

const safeOffset = Number.isFinite(rawOffset) ? rawOffset : undefined;

Type guard

const isValidOffset = (v: unknown): v is number =>
  typeof v === 'number' && !Number.isNaN(v);

Prevention

When it happens

Trigger: offset={NaN}, offset={Number('x')}, offset from parseInt('') , or any calculation producing NaN.

Common situations: Parsing user input with parseInt without validation; conditional returning undefined that gets coerced; math on undefined operands.

Related errors


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