{"record":{"id":"55b73b7f7ca466f0","repo":"remotion-dev/remotion","slug":"type-of-startfrom-prop-must-be-a-number-instead-g","errorCode":null,"errorMessage":"type of startFrom prop must be a number, instead got type ${typeof startFrom}.","messagePattern":"type of startFrom 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":7,"sourceCode":"export const validateStartFromProps = (\n\tstartFrom: number | undefined,\n\tendAt: number | undefined,\n) => {\n\tif (typeof startFrom !== 'undefined') {\n\t\tif (typeof startFrom !== 'number') {\n\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(","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validate-start-from-props.ts#L1-L25","documentation":"The deprecated `startFrom` prop on media components (<Audio>, <Video>, <OffthreadVideo>, etc.) must be a number representing the frame to start playing from. validateStartFromProps checks the runtime type because JavaScript values from props destructuring, config files, or JSON may arrive as strings. Non-number values are rejected before they reach the playback logic.","triggerScenarios":"Passing startFrom as a string (startFrom=\"100\"), an object, or any non-number non-undefined value to a media component that accepts startFrom.","commonSituations":"Reading startFrom from a JSON scene descriptor where it is serialized as a string; passing a value from URL params or a CMS without conversion; copy-pasting a value with quotes from documentation.","solutions":["Pass startFrom as a numeric literal: startFrom={100}.","If the value is a string, parse it: startFrom={Number(myStr)} (after confirming it is not NaN).","Migrate to the replacement prop `trimBefore`, which has the same semantics and is not deprecated.","Omit the prop if you do not need to offset the start."],"exampleFix":"// before\n<Audio src={src} startFrom=\"60\" />\n// after\n<Audio src={src} trimBefore={60} />","handlingStrategy":"type-guard","validationCode":"if (startFrom !== undefined && typeof startFrom !== 'number') {\n  throw new Error('startFrom must be a number or undefined');\n}","typeGuard":"const isStartFrom = (v: unknown): v is number | undefined =>\n  v === undefined || typeof v === 'number';","tryCatchPattern":null,"preventionTips":["Migrate from startFrom to the non-deprecated trimBefore to avoid future removal.","Parse string sources with Number() and validate before passing.","Keep scene/config descriptors typed so numbers are not silently 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"}