{"record":{"id":"4d97b4a357feaca0","repo":"remotion-dev/remotion","slug":"new-composition-source-does-not-match-installation-target","errorCode":null,"errorMessage":"New composition source does not match installation target","messagePattern":"New composition source does not match installation target","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/browser-studio-operations.ts","lineNumber":2056,"sourceCode":"\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst originalProject = getProject();\n\t\t\t\tlet project = originalProject;\n\t\t\t\tif (request.newComposition !== null) {\n\t\t\t\t\tif (request.newComposition.codemod.newId !== request.compositionId) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t'New composition ID does not match installation target',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst absolutePath = resolveCodemodTargetFile({\n\t\t\t\t\t\tcodemod: request.newComposition.codemod,\n\t\t\t\t\t\tproject,\n\t\t\t\t\t\tsymbolicatedStack: request.newComposition.symbolicatedStack,\n\t\t\t\t\t});\n\t\t\t\t\tif (absolutePath !== request.compositionFile) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t'New composition source does not match installation target',\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst input = project.files[absolutePath];\n\t\t\t\t\tconst {newContents} = parseAndApplyCodemod({\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tcodeMod: request.newComposition.codemod,\n\t\t\t\t\t});\n\t\t\t\t\tconst componentFilePath = `${dirname(absolutePath)}/${request.newComposition.codemod.componentName}.tsx`;\n\t\t\t\t\tif (project.files[componentFilePath] !== undefined) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Cannot create ${relativeToRoot(componentFilePath, project.rootDir)} because it already exists`,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tproject = {\n\t\t\t\t\t\t...project,","sourceCodeStart":2038,"sourceCodeEnd":2074,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/browser-studio/src/browser-studio-operations.ts#L2038-L2074","documentation":"The codemod for a new composition must target the same source file as the request's compositionFile installation target. resolveCodemodTargetFile derives the file from the codemod plus symbolicated stack; if it differs from request.compositionFile, the request is internally inconsistent and would write the new composition into the wrong file, so the operation throws.","triggerScenarios":"request.newComposition is non-null and the resolved absolute codemod target path !== request.compositionFile.","commonSituations":"Symbolicated stack pointing at a moved/renamed file; requests assembled from stale project state; monorepo aliases resolving to a different path form than the UI recorded.","solutions":["Update request.compositionFile to match the file the codemod resolves to.","Fix the codemod or symbolicatedStack so the target resolves to the intended file.","Recreate the request after the file was moved or renamed."],"exampleFix":"// before\n{compositionFile: '/src/Root.tsx', codemod: {...targeting /src/Root2.tsx}}\n// after\n{compositionFile: '/src/Root2.tsx', codemod: {...targeting /src/Root2.tsx}}","handlingStrategy":"validation","validationCode":"const resolved = resolveCodemodTargetFile({codemod, project, symbolicatedStack});\nif (resolved !== compositionFile) throw new Error('codemod target mismatch');","typeGuard":null,"tryCatchPattern":"try {\n  await applyOperation(request);\n} catch (e) {\n  if (String(e).includes('source does not match')) refreshRequestFromProject();\n}","preventionTips":["Rebuild requests after files move or are renamed.","Keep symbolicated stacks in sync with the project files map.","Normalize paths (same absolute form) when constructing requests."],"tags":["validation","studio","codemod"],"backgroundTag":"invalid-argument-value","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}