{"record":{"id":"adc8f81dad9abb02","repo":"remotion-dev/remotion","slug":"durationinframes-must-be-positive-but-got-durat","errorCode":null,"errorMessage":"durationInFrames must be positive, but got ${durationInFrames}","messagePattern":"durationInFrames must be positive, but got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/Sequence.tsx","lineNumber":213,"sourceCode":"\t\tbottom: resolvedCropBottom,\n\t} = resolveSequenceCrop(cropProps);\n\t// @ts-expect-error\n\tif (layout === 'none' && typeof other.style !== 'undefined') {\n\t\tthrow new TypeError(\n\t\t\t'If layout=\"none\", you may not pass a style. Passed: ' +\n\t\t\t\t// @ts-expect-error\n\t\t\t\tJSON.stringify(other.style),\n\t\t);\n\t}\n\n\tif (typeof durationInFrames !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`You passed to durationInFrames an argument of type ${typeof durationInFrames}, but it must be a number.`,\n\t\t);\n\t}\n\n\tif (durationInFrames <= 0) {\n\t\tthrow new TypeError(\n\t\t\t`durationInFrames must be positive, but got ${durationInFrames}`,\n\t\t);\n\t}\n\n\tif (typeof from !== 'number') {\n\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(","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/Sequence.tsx#L195-L231","documentation":"Thrown by <Sequence> when durationInFrames is a number but is <= 0 (zero or negative). A sequence with non-positive duration is meaningless on the timeline and would cause downstream math (parent-clamping, frame-window calculation) to produce empty or inverted ranges. The check fires after the type check.","triggerScenarios":"Passing `durationInFrames={0}`, `durationInFrames={-10}`, or a computed value that crosses zero; passing Infinity is allowed at runtime here but should be avoided.","commonSituations":"Animating duration from a starting value of 0; computing duration from a subtraction that can go negative; defaulting to 0 before metadata loads.","solutions":["Pass a positive integer: `durationInFrames={30}` (at least 1).","Clamp computed values: `durationInFrames={Math.max(1, Math.round(value))}`.","Defer mounting until duration is known and positive: `{d > 0 && <Sequence durationInFrames={d} />}`.","Audit default props and config loaders to ensure duration is never 0 or negative."],"exampleFix":"// before\n<Sequence durationInFrames={state.loaded ? state.duration : 0} />\n// after\n{state.loaded && state.duration > 0 && (\n  <Sequence durationInFrames={Math.max(1, Math.round(state.duration))} />\n)}","handlingStrategy":"validation","validationCode":"if (typeof durationInFrames === 'number' && durationInFrames <= 0) {\n  throw new RangeError(`durationInFrames must be positive; got ${durationInFrames}`);\n}","typeGuard":"const isPositive = (n: unknown): n is number =>\n  typeof n === 'number' && n > 0 && Number.isFinite(n);","tryCatchPattern":null,"preventionTips":["Clamp computed durations with `Math.max(1, Math.round(value))`.","Defer mounting Sequence until duration is positive.","Avoid animating duration through zero.","Sanitize config loaders so duration is never 0 or negative."],"tags":["sequence","duration","validation","math"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}