{"record":{"id":"7b45f324f290cd9d","repo":"remotion-dev/remotion","slug":"the-durationinframes-prop-component-is-missin","errorCode":null,"errorMessage":"The \"durationInFrames\" prop ${component} is missing.","messagePattern":"The \"durationInFrames\" prop (.+?) is missing\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/validation/validate-duration-in-frames.ts","lineNumber":10,"sourceCode":"export function validateDurationInFrames(\n\tdurationInFrames: unknown,\n\toptions: {\n\t\tcomponent: string;\n\t\tallowFloats: boolean;\n\t},\n): asserts durationInFrames is number {\n\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);","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validation/validate-duration-in-frames.ts#L1-L28","documentation":"`validateDurationInFrames` requires a `durationInFrames` value to be present. `undefined` throws 'is missing' before any type/range checks. It runs for `<Composition>`, `<Series.Sequence>`, and `<Loop>` (and during config resolution), with the `component` string identifying which one.","triggerScenarios":"Omitting `durationInFrames` on a `<Composition>`, `<Series.Sequence>`, or `<Loop>` where no `calculateMetadata` supplies it; or a `calculateMetadata` that returns an object lacking the key.","commonSituations":"Forgetting the prop while relying on metadata that does not return it; a metadata function that throws or short-circuits before setting duration; copy-paste from a still (which has no duration).","solutions":["Add `durationInFrames={N}` to the component.","If duration is dynamic, ensure `calculateMetadata` returns `durationInFrames`.","Provide a sensible default rather than leaving it undefined."],"exampleFix":"// before\n<Composition id=\"x\" component={X} fps={30} width={1920} height={1080} />\n// after\n<Composition id=\"x\" component={X} fps={30} width={1920} height={1080} durationInFrames={150} />","handlingStrategy":"validation","validationCode":"if (durationInFrames === undefined) {\n  throw new Error('durationInFrames is required');\n}","typeGuard":"const hasDuration = (d) => d !== undefined && d !== null;","tryCatchPattern":null,"preventionTips":["Always set durationInFrames explicitly on <Composition>.","Ensure calculateMetadata returns durationInFrames on every code path."],"tags":["validation","composition","duration","missing-prop","series","loop"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}