remotion-dev/remotion · error · TypeError

type of startFrom prop must be a number, instead got type ${

Error message

type of startFrom prop must be a number, instead got type ${typeof startFrom}.

What it means

The deprecated `startFrom` prop on media components (<Audio>, <Video>, <OffthreadVideo>, etc.) must be a number representing the frame to start playing from. validateStartFromProps checks the runtime type because JavaScript values from props destructuring, config files, or JSON may arrive as strings. Non-number values are rejected before they reach the playback logic.

Source

Thrown at packages/core/src/validate-start-from-props.ts:7

export const validateStartFromProps = (
	startFrom: number | undefined,
	endAt: number | undefined,
) => {
	if (typeof startFrom !== 'undefined') {
		if (typeof startFrom !== 'number') {
			throw new TypeError(
				`type of startFrom prop must be a number, instead got type ${typeof startFrom}.`,
			);
		}

		if (isNaN(startFrom) || startFrom === Infinity) {
			throw new TypeError('startFrom prop can not be NaN or Infinity.');
		}

		if (startFrom < 0) {
			throw new TypeError(
				`startFrom must be greater than equal to 0 instead got ${startFrom}.`,
			);
		}
	}

	if (typeof endAt !== 'undefined') {
		if (typeof endAt !== 'number') {
			throw new TypeError(

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Pass startFrom as a numeric literal: startFrom={100}.
  2. If the value is a string, parse it: startFrom={Number(myStr)} (after confirming it is not NaN).
  3. Migrate to the replacement prop `trimBefore`, which has the same semantics and is not deprecated.
  4. Omit the prop if you do not need to offset the start.

Example fix

// before
<Audio src={src} startFrom="60" />
// after
<Audio src={src} trimBefore={60} />
Defensive patterns

Strategy: type-guard

Validate before calling

if (startFrom !== undefined && typeof startFrom !== 'number') {
  throw new Error('startFrom must be a number or undefined');
}

Type guard

const isStartFrom = (v: unknown): v is number | undefined =>
  v === undefined || typeof v === 'number';

Prevention

When it happens

Trigger: Passing startFrom as a string (startFrom="100"), an object, or any non-number non-undefined value to a media component that accepts startFrom.

Common situations: Reading startFrom from a JSON scene descriptor where it is serialized as a string; passing a value from URL params or a CMS without conversion; copy-pasting a value with quotes from documentation.

Related errors


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