{"record":{"id":"8741be70357850b0","repo":"remotion-dev/remotion","slug":"the-trimbefore-prop-of-sequence-must-be-grea","errorCode":null,"errorMessage":"The \"trimBefore\" prop of <Sequence /> must be greater than or equal to 0, but got ${trimBefore}.","messagePattern":"The \"trimBefore\" prop of <Sequence /> must be greater than or equal to 0, but got (.+?)\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/Sequence.tsx","lineNumber":237,"sourceCode":"\t\tthrow new TypeError(\n\t\t\t`You passed to the \"from\" props of your <Sequence> an argument of type ${typeof from}, but it must be a number.`,\n\t\t);\n\t}\n\n\tif (!Number.isFinite(from)) {\n\t\tthrow new TypeError(\n\t\t\t`The \"from\" prop of a sequence must be finite, but got ${from}.`,\n\t\t);\n\t}\n\n\tif (typeof trimBefore !== 'number') {\n\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') {","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/Sequence.tsx#L219-L255","documentation":"Thrown when <Sequence> receives a trimBefore value less than 0. Negative trimming is meaningless (you cannot trim frames before the sequence start), so Remotion rejects it.","triggerScenarios":"Passing a computed trimBefore that went negative (e.g. trimBefore = from - offset where offset > from), or arithmetic underflow from subtracting timestamps.","commonSituations":"Deriving trimBefore from user-controlled offsets, misordered start/end props, off-by-one in seek calculations, negative results from Math.round on small negatives.","solutions":["Clamp trimBefore to a minimum of 0: trimBefore={Math.max(0, value)}.","Re-check the formula producing trimBefore; ensure the subtrahend never exceeds the minuend.","Add a runtime assertion at the call site before rendering."],"exampleFix":"// before\n<Sequence from={10} trimBefore={start - offset} />\n\n// after\n<Sequence from={10} trimBefore={Math.max(0, start - offset)} />","handlingStrategy":"validation","validationCode":"const trim = Math.max(0, Number(rawTrimBefore));\n<Sequence trimBefore={trim} />","typeGuard":"const isNonNegativeFinite = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v >= 0;","tryCatchPattern":null,"preventionTips":["Clamp derived trim values with Math.max(0, ...) at the call site.","Unit-test offset arithmetic with edge cases where offset exceeds start."],"tags":["sequence","props","validation","math"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}