remotion-dev/remotion · error · Error

The 'frame' prop of <Freeze /> must be a number, but is of t

Error message

The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof frameToFreeze}

What it means

Thrown by <Freeze /> when the `frame` prop is defined but not a number (e.g. a string like '30'). TypeScript types usually prevent this, but it surfaces at runtime in loosely-typed or serialized input.

Source

Thrown at packages/core/src/freeze.tsx:35

 * @description Freezes its children at the specified frame when rendering videos.
 * @see [Documentation](https://remotion.dev/docs/freeze)
 */
export const Freeze: React.FC<FreezeProps> = ({
	frame: frameToFreeze,
	children,
	active = true,
}) => {
	const frame = useCurrentFrame();
	const videoConfig = useVideoConfig();

	if (typeof frameToFreeze === 'undefined') {
		throw new Error(
			`The <Freeze /> component requires a 'frame' prop, but none was passed.`,
		);
	}

	if (typeof frameToFreeze !== 'number') {
		throw new Error(
			`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof frameToFreeze}`,
		);
	}

	if (Number.isNaN(frameToFreeze)) {
		throw new Error(
			`The 'frame' prop of <Freeze /> must be a real number, but it is NaN.`,
		);
	}

	if (!Number.isFinite(frameToFreeze)) {
		throw new Error(
			`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`,
		);
	}

	const isActive = useMemo(() => {
		if (typeof active === 'boolean') {

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Coerce before passing: frame={Number(frameProp)}.
  2. Validate the upstream serialization to preserve numeric types (use Remotion's input-props deserialization rather than raw JSON.parse).
  3. Type the prop source as number so the mismatch is caught at compile time.

Example fix

// before (frame came in as a string from input props)
<Freeze frame={inputFrame}>{scene}</Freeze>

// after
<Freeze frame={Number(inputFrame)}>{scene}</Freeze>
Defensive patterns

Strategy: type-guard

Validate before calling

const frameNum = Number(frameProp);
if (!Number.isFinite(frameNum)) {
  throw new Error(`frame must be a finite number, got ${frameProp}`);
}
return <Freeze frame={frameNum}>{children}</Freeze>;

Type guard

const isNumericFrame = (v: unknown): v is number => typeof v === 'number';

Prevention

When it happens

Trigger: Passing frame as a string, object, or boolean; deserializing props from JSON where the number was stringified and not coerced back.

Common situations: Input props loaded from JSON/CLI where numbers arrive as strings; dynamic prop injection from untyped sources.

Related errors


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