{"record":{"id":"05d62e562888579b","repo":"remotion-dev/remotion","slug":"cannot-use-both-startfrom-and-trimbefore-props-us","errorCode":null,"errorMessage":"Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.","messagePattern":"Cannot use both startFrom and trimBefore props\\. Use trimBefore instead as startFrom is deprecated\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validate-start-from-props.ts","lineNumber":104,"sourceCode":"\tif ((trimAfter as number) <= (trimBefore as number)) {\n\t\tthrow new TypeError('trimAfter prop must be greater than trimBefore prop.');\n\t}\n};\n\nexport const validateMediaTrimProps = ({\n\tstartFrom,\n\tendAt,\n\ttrimBefore,\n\ttrimAfter,\n}: {\n\tstartFrom: number | undefined;\n\tendAt: number | undefined;\n\ttrimBefore: number | undefined;\n\ttrimAfter: number | undefined;\n}) => {\n\t// Check for conflicting props\n\tif (typeof startFrom !== 'undefined' && typeof trimBefore !== 'undefined') {\n\t\tthrow new TypeError(\n\t\t\t'Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.',\n\t\t);\n\t}\n\n\tif (typeof endAt !== 'undefined' && typeof trimAfter !== 'undefined') {\n\t\tthrow new TypeError(\n\t\t\t'Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.',\n\t\t);\n\t}\n\n\t// Validate using the appropriate validation function\n\tconst hasNewProps =\n\t\ttypeof trimBefore !== 'undefined' || typeof trimAfter !== 'undefined';\n\tconst hasOldProps =\n\t\ttypeof startFrom !== 'undefined' || typeof endAt !== 'undefined';\n\n\tif (hasNewProps) {\n\t\tvalidateTrimProps(trimBefore, trimAfter);","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validate-start-from-props.ts#L86-L122","documentation":"Media components support both the deprecated startFrom prop and its non-deprecated replacement trimBefore, but not both at once. validateMediaTrimProps detects the conflict because allowing both would make the intended trim ambiguous. The error message directs you to use trimBefore, since startFrom is deprecated.","triggerScenarios":"Passing both startFrom and trimBefore on the same media component, e.g. <Video src={src} startFrom={30} trimBefore={40} />.","commonSituations":"Partially migrating a component from startFrom to trimBefore and forgetting to remove the old prop; merging two configs/props objects where one sets startFrom and the other sets trimBefore; copy-pasting examples that mix old and new APIs.","solutions":["Remove the deprecated startFrom prop and keep only trimBefore.","If you must keep the old prop temporarily, remove trimBefore until migration is complete.","Search the codebase for both props on the same element to catch spread-merge conflicts."],"exampleFix":"// before\n<Video src={src} startFrom={30} trimBefore={40} />\n// after\n<Video src={src} trimBefore={40} />","handlingStrategy":"validation","validationCode":"if (startFrom !== undefined && trimBefore !== undefined) {\n  throw new Error('Pass only trimBefore; startFrom is deprecated');\n}","typeGuard":"const hasNoStartFromConflict = (\n  startFrom: unknown,\n  trimBefore: unknown,\n): boolean => startFrom === undefined || trimBefore === undefined;","tryCatchPattern":null,"preventionTips":["Complete the migration from startFrom to trimBefore and remove all startFrom usages.","When merging props objects, delete the deprecated key before assigning the new one.","Add an ESLint ban rule or codemod for startFrom to prevent reintroduction."],"tags":["validation","props","deprecated","migration","trimming"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}