remotion-dev/remotion · error · TypeError
startFrom must be greater than equal to 0 instead got ${star
Error message
startFrom must be greater than equal to 0 instead got ${startFrom}. What it means
The deprecated startFrom prop represents a frame offset into the media, so it cannot be negative — there is no frame before 0. validateStartFromProps rejects negative numbers to prevent the playback logic from seeking to an invalid position.
Source
Thrown at packages/core/src/validate-start-from-props.ts:17
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(
`type of endAt prop must be a number, instead got type ${typeof endAt}.`,
);
}
if (isNaN(endAt)) {
throw new TypeError('endAt prop can not be NaN.');
}
if (endAt <= 0) {
throw new TypeError(View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Clamp the value to a minimum of 0: startFrom={Math.max(0, computed)}.
- Fix the sign/logic error in the offset calculation.
- Migrate to the non-deprecated trimBefore prop (same non-negative constraint applies).
- If the intent is to delay rather than trim, use a <Sequence> with a positive from instead.
Example fix
// before
<Video src={src} startFrom={offset - 30} />
// after
<Video src={src} trimBefore={Math.max(0, offset - 30)} /> Defensive patterns
Strategy: validation
Validate before calling
if (startFrom !== undefined && startFrom < 0) {
throw new Error('startFrom must be >= 0');
} Type guard
const isValidStartFrom = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v) && v >= 0;
Prevention
- Clamp dynamic offsets with Math.max(0, value) before passing.
- Use a <Sequence> with a positive `from` when you want to delay rather than trim.
- Prefer trimBefore over the deprecated startFrom.
When it happens
Trigger: Passing startFrom with a negative value, e.g. startFrom={-10}, or a computed expression that goes negative (e.g. startFrom={offset - margin} where margin exceeds offset).
Common situations: Subtracting a padding/margin constant from a dynamic offset without clamping; sign errors when computing a relative offset; passing a value computed from a timestamp that can be negative for early frames.
Related errors
- endAt must be a positive number, instead got ${endAt}.
- endAt prop must be greater than startFrom prop.
- type of startFrom prop must be a number, instead got type ${
- startFrom prop can not be NaN or Infinity.
- type of endAt prop must be a number, instead got type ${type
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/c5a547a15333259c.
Report an issue: GitHub.