remotion-dev/remotion · error · TypeError
You have passed a playbackRate of ${props.playbackRate} to y
Error message
You have passed a playbackRate of ${props.playbackRate} to your <${component} /> component. Playback rate must be a real number above 0. What it means
validateMediaProps throws a TypeError when playbackRate is a number but is NaN, not finite, or <= 0. Remotion requires a positive real playback rate (e.g. 0.5, 1, 2); zero, negative, NaN, and Infinity are rejected because they break media timing.
Source
Thrown at packages/core/src/validate-media-props.ts:42
);
}
if (
typeof props.playbackRate !== 'number' &&
typeof props.playbackRate !== 'undefined'
) {
throw new TypeError(
`You have passed a playbackRate of type ${typeof props.playbackRate} to your <${component} /> component. Playback rate must a real number or undefined.`,
);
}
if (
typeof props.playbackRate === 'number' &&
(isNaN(props.playbackRate) ||
!Number.isFinite(props.playbackRate) ||
props.playbackRate <= 0)
) {
throw new TypeError(
`You have passed a playbackRate of ${props.playbackRate} to your <${component} /> component. Playback rate must be a real number above 0.`,
);
}
if (
typeof props.preservePitch !== 'boolean' &&
typeof props.preservePitch !== 'undefined'
) {
throw new TypeError(
`'preservePitch' must be a boolean or undefined but got '${typeof props.preservePitch}' instead`,
);
}
};
View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Default to a valid positive rate: `playbackRate={rate || 1}`.
- Guard against non-finite: `Number.isFinite(rate) && rate > 0 ? rate : 1`.
- Fix upstream math that produces 0/NaN/Infinity.
- Validate the source value before passing.
Example fix
// before
<Video src={url} playbackRate={speed} /> // speed is 0 or NaN
// after
const safeRate = Number.isFinite(speed) && speed > 0 ? speed : 1;
<Video src={url} playbackRate={safeRate} /> Defensive patterns
Strategy: validation
Validate before calling
const safeRate = Number.isFinite(rate) && rate > 0 ? rate : 1; // then pass safeRate
Type guard
const isPositiveFiniteRate = (r: unknown): r is number => typeof r === 'number' && Number.isFinite(r) && r > 0;
Prevention
- Default playbackRate to 1 when the computed value is invalid.
- Guard divisions producing 0/Infinity/NaN.
- Validate config values for positive finite numbers.
When it happens
Trigger: Passing playbackRate=0; negative rates; NaN from failed parses; Infinity from division by zero; rates computed from optional fields that resolved to 0 or NaN.
Common situations: Defaulting rate to 0; division by zero in rate math; parseFloat failures; config with rate=0; sign errors producing negative rates.
Related errors
- You have passed a volume below 0 to your <${component} /> co
- You have passed a playbackRate of type ${typeof props.playba
- You have passed a volume of type ${typeof props.volume} to y
- 'preservePitch' must be a boolean or undefined but got '${ty
- The "playbackRate" props must be a real number, but is ${pla
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/a8060ea35a1c85fe.
Report an issue: GitHub.