{"record":{"id":"24f8e407d2856caf","repo":"remotion-dev/remotion","slug":"the-durationinframes-prop-component-must-be-f","errorCode":null,"errorMessage":"The \"durationInFrames\" prop ${component} must be finite, but got ${durationInFrames}.","messagePattern":"The \"durationInFrames\" prop (.+?) must be finite, but got (.+?)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-duration-in-frames.ts","lineNumber":32,"sourceCode":"\t\tthrow new Error(\n\t\t\t`The \"durationInFrames\" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`,\n\t\t);\n\t}\n\n\tif (durationInFrames <= 0) {\n\t\tthrow new TypeError(\n\t\t\t`The \"durationInFrames\" prop ${component} must be positive, but got ${durationInFrames}.`,\n\t\t);\n\t}\n\n\tif (!allowFloats && durationInFrames % 1 !== 0) {\n\t\tthrow new TypeError(\n\t\t\t`The \"durationInFrames\" prop ${component} must be an integer, but got ${durationInFrames}.`,\n\t\t);\n\t}\n\n\tif (!Number.isFinite(durationInFrames)) {\n\t\tthrow new TypeError(\n\t\t\t`The \"durationInFrames\" prop ${component} must be finite, but got ${durationInFrames}.`,\n\t\t);\n\t}\n}\n","sourceCodeStart":14,"sourceCodeEnd":37,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-duration-in-frames.ts#L14-L37","documentation":"`validateDurationInFrames` rejects non-finite (`Infinity`/`-Infinity`) durations. Note `<Series.Sequence>` intentionally allows `Infinity` for its last sequence and skips the validator in that case; everywhere else (notably `<Composition>`), an infinite duration throws.","triggerScenarios":"Setting `durationInFrames={Infinity}` on a `<Composition>`, or returning `Infinity` from its `calculateMetadata`; passing Infinity to `<Loop>` or to a non-final `<Series.Sequence>`.","commonSituations":"Using Infinity as a 'play forever' sentinel on a `<Composition>` (not supported); a metadata calculation that divides by zero or aggregates an empty set.","solutions":["Use a large but finite duration if you need near-unbounded playback.","Ensure `calculateMetadata` returns a finite number.","Reserve Infinity only for the last `<Series.Sequence>`."],"exampleFix":"// before\n<Composition durationInFrames={Infinity} ... />\n// after\n<Composition durationInFrames={Number.MAX_SAFE_INTEGER} ... /> // or a real finite value","handlingStrategy":"validation","validationCode":"if (!Number.isFinite(d)) { throw new Error('duration must be finite'); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not set Infinity on <Composition> durations.","Gate metadata-derived durations with Number.isFinite()."],"tags":["validation","composition","duration","infinity","series"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}