{"record":{"id":"885eeb88cd237be8","repo":"remotion-dev/remotion","slug":"new-composition-id-does-not-match-installation-target","errorCode":null,"errorMessage":"New composition ID does not match installation target","messagePattern":"New composition ID does not match installation target","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/browser-studio-operations.ts","lineNumber":2045,"sourceCode":"\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tcomponentOwnsSequence &&\n\t\t\t\t\trequest.element.initialProps?.style !== undefined &&\n\t\t\t\t\t(request.element.initialProps.style === null ||\n\t\t\t\t\t\ttypeof request.element.initialProps.style !== 'object' ||\n\t\t\t\t\t\tArray.isArray(request.element.initialProps.style))\n\t\t\t\t) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Component-owned Element initial style must be an object',\n\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,","sourceCodeStart":2027,"sourceCodeEnd":2063,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/browser-studio/src/browser-studio-operations.ts#L2027-L2063","documentation":"When a browser-studio operation installs a new composition via a codemod, the codemod's newId must equal the request's compositionId — the ID the UI expects the new composition to register under. A mismatch means the codemod and the request disagree about what the composition will be called, so the result would not match the installation target. The operation aborts before writing any files.","triggerScenarios":"request.newComposition is non-null and request.newComposition.codemod.newId !== request.compositionId.","commonSituations":"Stale or hand-edited codemod payloads; agents renaming a composition in one place but not the other; retrying an operation after the target ID changed.","solutions":["Regenerate the codemod so newId matches request.compositionId.","Update the request's compositionId to the codemod's newId.","Re-run the flow that produced the installation request so both fields are derived from one source."],"exampleFix":"// before\n{compositionId: 'MyComp', codemod: {newId: 'MyCompOld'}}\n// after\n{compositionId: 'MyComp', codemod: {newId: 'MyComp'}}","handlingStrategy":"validation","validationCode":"if (newComposition && newComposition.codemod.newId !== compositionId)\n  throw new Error('newId must equal compositionId');","typeGuard":null,"tryCatchPattern":"try {\n  await applyOperation(request);\n} catch (e) {\n  if (String(e).includes('does not match installation target')) rebuildRequest();\n}","preventionTips":["Derive newId and compositionId from a single source of truth.","Regenerate the whole request after any rename.","Add a pre-submit consistency check for newComposition requests."],"tags":["validation","studio","codemod"],"backgroundTag":"invalid-identifier-format","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"}