{"record":{"id":"4dbd3876a69504ad","repo":"remotion-dev/remotion","slug":"the-durationinframes-prop-component-must-be-a-4dbd38","errorCode":null,"errorMessage":"The \"durationInFrames\" prop ${component} must be an integer, but got ${durationInFrames}.","messagePattern":"The \"durationInFrames\" prop (.+?) must be an integer, but got (.+?)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-duration-in-frames.ts","lineNumber":26,"sourceCode":"\tconst {allowFloats, component} = options;\n\tif (typeof durationInFrames === 'undefined') {\n\t\tthrow new Error(`The \"durationInFrames\" prop ${component} is missing.`);\n\t}\n\n\tif (typeof durationInFrames !== 'number') {\n\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":8,"sourceCodeEnd":37,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-duration-in-frames.ts#L8-L37","documentation":"`validateDurationInFrames` requires an integer duration when `allowFloats` is false. `<Composition>` resolves durations with `allowFloats:false`, so a fractional `durationInFrames` throws. Note `<Series.Sequence>` uses `allowFloats:true`, so this specific message primarily comes from `<Composition>`/config resolution.","triggerScenarios":"Passing a fractional `durationInFrames` (e.g. `1.5`, `100.25`) to a `<Composition>`, or returning a fractional duration from `calculateMetadata` for a composition.","commonSituations":"Computing duration from seconds × fps where the product is not a whole number (`Math.ceil(seconds * fps)` left unrounded, or `seconds * 30` yielding a float); an aspect/sample-rate derived duration.","solutions":["Round to a whole frame: `Math.round(seconds * fps)`.","Validate `Number.isInteger()` before assigning.","Choose durations that divide evenly with fps."],"exampleFix":"// before\nconst durationInFrames = seconds * fps; // e.g. 2.5 * 30 = 75 (ok), 1.1 * 30 = 33 (ok)... but 1.05*30=31.5 -> throws\n<Composition durationInFrames={durationInFrames} ... />\n// after\nconst durationInFrames = Math.round(seconds * fps);\n<Composition durationInFrames={durationInFrames} ... />","handlingStrategy":"validation","validationCode":"if (d % 1 !== 0) { throw new Error('duration must be an integer'); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always Math.round(seconds * fps) when deriving duration.","Validate Number.isInteger() for composition durations."],"tags":["validation","composition","duration","integer","calculate-metadata"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}