{"record":{"id":"dc516905685173f3","repo":"remotion-dev/remotion","slug":"cannot-use-both-endat-and-trimafter-props-use-tri","errorCode":null,"errorMessage":"Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.","messagePattern":"Cannot use both endAt and trimAfter props\\. Use trimAfter instead as endAt is deprecated\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/src/validate-start-from-props.ts","lineNumber":110,"sourceCode":"\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);\n\t} else if (hasOldProps) {\n\t\tvalidateStartFromProps(startFrom, endAt);\n\t}\n};\n\nexport const resolveTrimProps = ({","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/validate-start-from-props.ts#L92-L128","documentation":"Media components support both the deprecated endAt prop and its non-deprecated replacement trimAfter, but not both at once. validateMediaTrimProps detects the conflict because allowing both would make the intended end frame ambiguous. The error message directs you to use trimAfter, since endAt is deprecated.","triggerScenarios":"Passing both endAt and trimAfter on the same media component, e.g. <Video src={src} endAt={200} trimAfter={180} />.","commonSituations":"Partially migrating a component from endAt to trimAfter and forgetting to remove the old prop; merging two configs/props objects where one sets endAt and the other sets trimAfter; copy-pasting examples that mix old and new APIs.","solutions":["Remove the deprecated endAt prop and keep only trimAfter.","If you must keep the old prop temporarily, remove trimAfter 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} endAt={200} trimAfter={180} />\n// after\n<Video src={src} trimAfter={180} />","handlingStrategy":"validation","validationCode":"if (endAt !== undefined && trimAfter !== undefined) {\n  throw new Error('Pass only trimAfter; endAt is deprecated');\n}","typeGuard":"const hasNoEndAtConflict = (\n  endAt: unknown,\n  trimAfter: unknown,\n): boolean => endAt === undefined || trimAfter === undefined;","tryCatchPattern":null,"preventionTips":["Complete the migration from endAt to trimAfter and remove all endAt usages.","When merging props objects, delete the deprecated key before assigning the new one.","Add an ESLint ban rule or codemod for endAt 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-12T18:17:37.767Z"}