{"record":{"id":"9550412d00ea5ec0","repo":"remotion-dev/remotion","slug":"the-trimbefore-prop-of-sequence-must-be-fini","errorCode":null,"errorMessage":"The \"trimBefore\" prop of <Sequence /> must be finite, but it is ${trimBefore}.","messagePattern":"The \"trimBefore\" prop of <Sequence /> must be finite, but it is (.+?)\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/Sequence.tsx","lineNumber":249,"sourceCode":"\t\tthrow new TypeError(\n\t\t\t`You passed to the \"trimBefore\" prop of your <Sequence> an argument of type ${typeof trimBefore}, but it must be a number.`,\n\t\t);\n\t}\n\n\tif (trimBefore < 0) {\n\t\tthrow new TypeError(\n\t\t\t`The \"trimBefore\" prop of <Sequence /> must be greater than or equal to 0, but got ${trimBefore}.`,\n\t\t);\n\t}\n\n\tif (Number.isNaN(trimBefore)) {\n\t\tthrow new TypeError(\n\t\t\t'The \"trimBefore\" prop of <Sequence /> must be a real number, but it is NaN.',\n\t\t);\n\t}\n\n\tif (!Number.isFinite(trimBefore)) {\n\t\tthrow new TypeError(\n\t\t\t`The \"trimBefore\" prop of <Sequence /> must be finite, but it is ${trimBefore}.`,\n\t\t);\n\t}\n\n\tif (typeof freeze !== 'undefined' && freeze !== null) {\n\t\tif (typeof freeze !== 'number') {\n\t\t\tthrow new TypeError(\n\t\t\t\t`The \"freeze\" prop of <Sequence /> must be a number, but is of type ${typeof freeze}.`,\n\t\t\t);\n\t\t}\n\n\t\tif (Number.isNaN(freeze)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`The \"freeze\" prop of <Sequence /> must be a real number, but it is NaN.`,\n\t\t\t);\n\t\t}\n\n\t\tif (!Number.isFinite(freeze)) {","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/Sequence.tsx#L231-L267","documentation":"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.","triggerScenarios":"trimBefore comes from a division that overflowed, an unbounded sum, or a default of Infinity propagated into the prop.","commonSituations":"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.","solutions":["Guard with Number.isFinite(trimBefore) before rendering.","Cap the value with Math.min(trimBefore, maxFrames).","Audit the upstream computation that produced Infinity."],"exampleFix":"// before\n<Sequence trimBefore={computed} />\n\n// after\n<Sequence trimBefore={Number.isFinite(computed) ? computed : 0} />","handlingStrategy":"validation","validationCode":"const safe = Number.isFinite(trimBefore) ? trimBefore : 0;","typeGuard":"const isFiniteNumber = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v);","tryCatchPattern":null,"preventionTips":["Audit sums and divisions that could overflow to Infinity.","Default optional numeric props to 0 rather than Infinity."],"tags":["sequence","props","infinity","validation"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}