{"record":{"id":"e76af6dba423d910","repo":"remotion-dev/remotion","slug":"project-changed-during-element-installation-pleas","errorCode":null,"errorMessage":"Project changed during Element installation. Please try again.","messagePattern":"Project changed during Element installation\\. Please try again\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/browser-studio-operations.ts","lineNumber":2145,"sourceCode":"\t\t\t\t\t\t\t\t\tdurationInFrames,\n\t\t\t\t\t\t\t\t\tfrom: request.from,\n\t\t\t\t\t\t\t\t\tname: request.element.displayName,\n\t\t\t\t\t\t\t\t\tposition: request.position,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\tconst projectWithElement = {\n\t\t\t\t\t...insertion.project,\n\t\t\t\t\tfiles: {\n\t\t\t\t\t\t...insertion.project.files,\n\t\t\t\t\t\t[plan.elementFilePath]: request.element.sourceCode,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tconst nextProject = addDependenciesToProject({\n\t\t\t\t\tdependencies: installedDependencies,\n\t\t\t\t\tproject: projectWithElement,\n\t\t\t\t});\n\t\t\t\tif (getProject() !== project) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'Project changed during Element installation. Please try again.',\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst nodePathMutation = controller.applyMutation({\n\t\t\t\t\ttimelineSelection: null,\n\t\t\t\t\tfileName: insertion.filePath,\n\t\t\t\t\tmutate: () => nextProject,\n\t\t\t\t\tnodePathMutationFiles: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tabsolutePath: insertion.filePath,\n\t\t\t\t\t\t\tremappings: insertion.nodePathRemappings,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t});\n\t\t\t\tif (nodePathMutation === null) {\n\t\t\t\t\tthrow new Error('Could not insert Element');\n\t\t\t\t}","sourceCodeStart":2127,"sourceCodeEnd":2163,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/browser-studio/src/browser-studio-operations.ts#L2127-L2163","documentation":"During a multi-step Element installation, the operations controller holds a reference to the project object it started with. After dependencies are added and before applying node-path mutations, it verifies the project reference is unchanged. If getProject() returns a different object, the project was reloaded/replaced concurrently, and applying the mutation would corrupt state — so the install aborts and asks the user to retry.","triggerScenarios":"Another operation (or the Studio UI) replacing/reloading the project while an Element installation is in progress; two installs running concurrently against the same project; a hot-reload or external mutation that swaps the project object mid-installation.","commonSituations":"User triggers a second install or project navigation while the first install's async work is still running; an editor or another automation client mutates the project during the install window.","solutions":["Retry the Element installation once the project state is stable (as the message says)","Ensure operations against the same project are serialized/awaited rather than fired concurrently","Avoid triggering project reloads or navigation while an installation is in flight","Check for duplicated/overlapping invocations of the install operation in your automation code"],"exampleFix":"// before\ninstallElement({...}); // not awaited, second call starts immediately\ninstallElement({...});\n// after\nawait installElement({...});\nawait installElement({...});","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n\tawait installElement({...});\n} catch (err) {\n\tif ((err as Error).message.includes('Project changed during Element installation')) {\n\t\tawait new Promise((r) => setTimeout(r, 500));\n\t\tawait installElement({...}); // retry once after state settles\n\t} else throw err;\n}","preventionTips":["Serialize all project-mutating operations (await each before the next)","Don't navigate or reload the project while an install is running","Queue concurrent user-triggered installs instead of running them in parallel"],"tags":["concurrency","state","retry"],"backgroundTag":"invalid-state-transition","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}