{"record":{"id":"c5a547a15333259c","repo":"remotion-dev/remotion","slug":"startfrom-must-be-greater-than-equal-to-0-instead","errorCode":null,"errorMessage":"startFrom must be greater than equal to 0 instead got ${startFrom}.","messagePattern":"startFrom must be greater than equal to 0 instead got (.+?)\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validate-start-from-props.ts","lineNumber":17,"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(\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(","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validate-start-from-props.ts#L1-L35","documentation":"The deprecated startFrom prop represents a frame offset into the media, so it cannot be negative — there is no frame before 0. validateStartFromProps rejects negative numbers to prevent the playback logic from seeking to an invalid position.","triggerScenarios":"Passing startFrom with a negative value, e.g. startFrom={-10}, or a computed expression that goes negative (e.g. startFrom={offset - margin} where margin exceeds offset).","commonSituations":"Subtracting a padding/margin constant from a dynamic offset without clamping; sign errors when computing a relative offset; passing a value computed from a timestamp that can be negative for early frames.","solutions":["Clamp the value to a minimum of 0: startFrom={Math.max(0, computed)}.","Fix the sign/logic error in the offset calculation.","Migrate to the non-deprecated trimBefore prop (same non-negative constraint applies).","If the intent is to delay rather than trim, use a <Sequence> with a positive from instead."],"exampleFix":"// before\n<Video src={src} startFrom={offset - 30} />\n// after\n<Video src={src} trimBefore={Math.max(0, offset - 30)} />","handlingStrategy":"validation","validationCode":"if (startFrom !== undefined && startFrom < 0) {\n  throw new Error('startFrom must be >= 0');\n}","typeGuard":"const isValidStartFrom = (v: unknown): v is number =>\n  typeof v === 'number' && Number.isFinite(v) && v >= 0;","tryCatchPattern":null,"preventionTips":["Clamp dynamic offsets with Math.max(0, value) before passing.","Use a <Sequence> with a positive `from` when you want to delay rather than trim.","Prefer trimBefore over the deprecated startFrom."],"tags":["validation","props","deprecated","trimming","range"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}