remotion-dev/remotion · error · TypeError
The "trimBefore" prop of <Sequence /> must be finite, but it
Error message
The "trimBefore" prop of <Sequence /> must be finite, but it is ${trimBefore}. What it means
Thrown when trimBefore is Infinity or -Infinity. Infinite trim values produce nonsensical sequence offsets and would break frame scheduling, so Remotion requires a finite number.
Source
Thrown at packages/core/src/Sequence.tsx:249
throw new TypeError(
`You passed to the "trimBefore" prop of your <Sequence> an argument of type ${typeof trimBefore}, but it must be a number.`,
);
}
if (trimBefore < 0) {
throw new TypeError(
`The "trimBefore" prop of <Sequence /> must be greater than or equal to 0, but got ${trimBefore}.`,
);
}
if (Number.isNaN(trimBefore)) {
throw new TypeError(
'The "trimBefore" prop of <Sequence /> must be a real number, but it is NaN.',
);
}
if (!Number.isFinite(trimBefore)) {
throw new TypeError(
`The "trimBefore" prop of <Sequence /> must be finite, but it is ${trimBefore}.`,
);
}
if (typeof freeze !== 'undefined' && freeze !== null) {
if (typeof freeze !== 'number') {
throw new TypeError(
`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof freeze}.`,
);
}
if (Number.isNaN(freeze)) {
throw new TypeError(
`The "freeze" prop of <Sequence /> must be a real number, but it is NaN.`,
);
}
if (!Number.isFinite(freeze)) {View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Guard with Number.isFinite(trimBefore) before rendering.
- Cap the value with Math.min(trimBefore, maxFrames).
- Audit the upstream computation that produced Infinity.
Example fix
// before
<Sequence trimBefore={computed} />
// after
<Sequence trimBefore={Number.isFinite(computed) ? computed : 0} /> Defensive patterns
Strategy: validation
Validate before calling
const safe = Number.isFinite(trimBefore) ? trimBefore : 0;
Type guard
const isFiniteNumber = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v);
Prevention
- Audit sums and divisions that could overflow to Infinity.
- Default optional numeric props to 0 rather than Infinity.
When it happens
Trigger: trimBefore comes from a division that overflowed, an unbounded sum, or a default of Infinity propagated into the prop.
Common situations: Spreading default-laden objects whose trimBefore defaulted to Infinity; summing an empty array (returns 0 but related ops can diverge); loading from JSON that explicitly contains Infinity-like strings.
Related errors
- The layout prop of <Sequence /> expects either "absolute-fil
- The cropLeft, cropRight, cropTop and cropBottom props of <Se
- If layout="none", you may not pass a style. Passed: ${JSON.s
- You passed to durationInFrames an argument of type ${typeof
- You passed to the "from" props of your <Sequence> an argumen
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/9550412d00ea5ec0.
Report an issue: GitHub.