{"record":{"id":"652e7621f6531f2a","repo":"remotion-dev/remotion","slug":"type-of-endat-prop-must-be-a-number-instead-got-t","errorCode":null,"errorMessage":"type of endAt prop must be a number, instead got type ${typeof endAt}.","messagePattern":"type of endAt prop must be a number, instead got type (.+?)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validate-start-from-props.ts","lineNumber":25,"sourceCode":"\t\t\tthrow new TypeError(\n\t\t\t\t`type of startFrom prop must be a number, instead got type ${typeof startFrom}.`,\n\t\t\t);\n\t\t}\n\n\t\tif (isNaN(startFrom) || startFrom === Infinity) {\n\t\t\tthrow new TypeError('startFrom prop can not be NaN or Infinity.');\n\t\t}\n\n\t\tif (startFrom < 0) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`startFrom must be greater than equal to 0 instead got ${startFrom}.`,\n\t\t\t);\n\t\t}\n\t}\n\n\tif (typeof endAt !== 'undefined') {\n\t\tif (typeof endAt !== 'number') {\n\t\t\tthrow new TypeError(\n\t\t\t\t`type of endAt prop must be a number, instead got type ${typeof endAt}.`,\n\t\t\t);\n\t\t}\n\n\t\tif (isNaN(endAt)) {\n\t\t\tthrow new TypeError('endAt prop can not be NaN.');\n\t\t}\n\n\t\tif (endAt <= 0) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`endAt must be a positive number, instead got ${endAt}.`,\n\t\t\t);\n\t\t}\n\t}\n\n\tif ((endAt as number) < (startFrom as number)) {\n\t\tthrow new TypeError('endAt prop must be greater than startFrom prop.');\n\t}","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validate-start-from-props.ts#L7-L43","documentation":"The deprecated `endAt` prop on media components specifies the frame at which playback should stop, and it must be a number. validateStartFromProps checks the runtime type because values destructured from props, configs, or JSON may arrive as strings rather than numbers.","triggerScenarios":"Passing endAt as a string (endAt=\"200\"), an object, or any non-number non-undefined value to a media component.","commonSituations":"Reading endAt from a JSON scene descriptor or CMS where numbers are serialized as strings; passing a value from URL query params without conversion.","solutions":["Pass endAt as a numeric literal: endAt={200}.","If the value is a string, parse it: endAt={Number(myStr)} after a finiteness check.","Migrate to the non-deprecated `trimAfter` prop, which has the same semantics.","Omit the prop if you do not need to cap the end."],"exampleFix":"// before\n<Audio src={src} endAt=\"180\" />\n// after\n<Audio src={src} trimAfter={180} />","handlingStrategy":"type-guard","validationCode":"if (endAt !== undefined && typeof endAt !== 'number') {\n  throw new Error('endAt must be a number or undefined');\n}","typeGuard":"const isEndAt = (v: unknown): v is number | undefined =>\n  v === undefined || typeof v === 'number';","tryCatchPattern":null,"preventionTips":["Migrate from endAt to the non-deprecated trimAfter to avoid future removal.","Parse string sources with Number() and validate before passing.","Type scene/config descriptors so numbers are not serialized as strings."],"tags":["validation","props","deprecated","trimming","typeerror"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}