{"record":{"id":"330e85f1af40bab1","repo":"remotion-dev/remotion","slug":"could-not-find-composition-compositionid","errorCode":null,"errorMessage":"Could not find composition \"${compositionId}\"","messagePattern":"Could not find composition \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/browser-studio-operations.ts","lineNumber":265,"sourceCode":"\tproject,\n\tsymbolicatedStack,\n}: {\n\tcodemod: RecastCodemod;\n\tproject: VirtualProject;\n\tsymbolicatedStack: SymbolicatedStackFrame | null;\n}): string => {\n\tif (symbolicatedStack?.originalFileName) {\n\t\treturn findProjectFile({\n\t\t\tfilePath: symbolicatedStack.originalFileName,\n\t\t\tproject,\n\t\t});\n\t}\n\n\tconst compositionId = getCodemodTargetCompositionId(codemod);\n\tif (compositionId !== null) {\n\t\tconst compositionFile = getCompositionFile({compositionId, project});\n\t\tif (compositionFile === null) {\n\t\t\tthrow new Error(`Could not find composition \"${compositionId}\"`);\n\t\t}\n\n\t\treturn findProjectFile({filePath: compositionFile, project});\n\t}\n\n\tif (codemod.type === 'rename-folder' || codemod.type === 'delete-folder') {\n\t\tconst folderFile = getFolderFile({\n\t\t\tfolderName: codemod.folderName,\n\t\t\tproject,\n\t\t});\n\t\tif (folderFile === null) {\n\t\t\tthrow new Error(`Could not find folder \"${codemod.folderName}\"`);\n\t\t}\n\n\t\treturn findProjectFile({filePath: folderFile, project});\n\t}\n\n\tif (","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/browser-studio/src/browser-studio-operations.ts#L247-L283","documentation":"resolveCodemodTargetFile (used by applyCodemod) locates the file a composition-addressed codemod should edit. For duplicate-composition, rename-composition, update-composition-metadata, delete-composition and move-composition-to-folder it looks the composition up by id via getCompositionFile; if the VirtualProject contains no composition with that id, this error is thrown with the id in quotes.","triggerScenarios":"applyCodemod with one of the five composition codemod types whose id (idToDuplicate / idToRename / idToUpdate / idToDelete / idToMove) does not exist in the current project, and no symbolicatedStack.originalFileName was supplied to bypass the composition lookup.","commonSituations":"Stale UI state issuing a delete/rename after the composition was already removed or renamed; the host replacing the project prop out-of-band so a queued codemod races against a newer project; ids captured before an undo that removed the composition.","solutions":["Re-read the composition list from the current project state before issuing the codemod and drop the request if the id is gone.","Discard queued codemods whenever the incoming project prop changes (BrowserStudio resets history on external project changes; mirror that for your queue).","Pass symbolicatedStack with originalFileName when the target file is already known, which bypasses the composition lookup."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const compositionExists = (project: VirtualProject, id: string): boolean =>\n  Object.values(project.files).some(\n    (source) => source.includes(`id=\"${id}\"`) || source.includes(`id={\"${id}\"}`),\n  );\n\nconst safeCodemod = compositionExists(project, codemod.idToDelete)\n  ? codemod\n  : null;","typeGuard":"const isCompositionTargetedCodemod = (\n  codemod: RecastCodemod,\n): codemod is\n  | {type: 'duplicate-composition'; idToDuplicate: string}\n  | {type: 'rename-composition'; idToRename: string}\n  | {type: 'update-composition-metadata'; idToUpdate: string}\n  | {type: 'delete-composition'; idToDelete: string}\n  | {type: 'move-composition-to-folder'; idToMove: string} =>\n  codemod.type === 'duplicate-composition' ||\n  codemod.type === 'rename-composition' ||\n  codemod.type === 'update-composition-metadata' ||\n  codemod.type === 'delete-composition' ||\n  codemod.type === 'move-composition-to-folder';","tryCatchPattern":null,"preventionTips":["Re-verify composition ids against the current project immediately before applying codemods.","Invalidate queued codemods when the project prop changes externally.","Consume undo/redo and project-change events to keep the id list fresh."],"tags":["codemod","composition","stale-state","virtual-project"],"backgroundTag":"composition-not-found","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}