{"record":{"id":"5719faa38f67458f","repo":"remotion-dev/remotion","slug":"result-reason","errorCode":null,"errorMessage":"${result.reason}","messagePattern":"\\$\\{result\\.reason\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/ElementInstallConfirmation.tsx","lineNumber":644,"sourceCode":"\t\t\tlet copyNumber = 1;\n\t\t\twhile (true) {\n\t\t\t\tconst result = await prepareElementInstall({\n\t\t\t\t\tinstallationName: candidate,\n\t\t\t\t\tdestination:\n\t\t\t\t\t\tmode === 'current-composition'\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\ttype: 'current-composition',\n\t\t\t\t\t\t\t\t\tcompositionFile: request.compositionFile,\n\t\t\t\t\t\t\t\t\tcompositionId: request.compositionId,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\ttype: 'new-composition',\n\t\t\t\t\t\t\t\t\tcompositionFile: selectedPlan.compositionFile,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\telement: request.element,\n\t\t\t\t});\n\t\t\t\tif (canceled) return;\n\t\t\t\tif (!result.success) throw new Error(result.reason);\n\n\t\t\t\tconst prepared = {\n\t\t\t\t\tbasePlan: selectedPlan,\n\t\t\t\t\tname: candidate,\n\t\t\t\t\trefresh: refreshPlan,\n\t\t\t\t\tplan: result.plan,\n\t\t\t\t};\n\t\t\t\tif (result.plan.expectedFileState.exists) {\n\t\t\t\t\tsetExistingInstallation((previous) =>\n\t\t\t\t\t\tprevious?.basePlan === selectedPlan &&\n\t\t\t\t\t\tprevious.refresh === refreshPlan\n\t\t\t\t\t\t\t? previous\n\t\t\t\t\t\t\t: prepared,\n\t\t\t\t\t);\n\t\t\t\t\tif (requestedName === null) {\n\t\t\t\t\t\tcandidate = `${elementBaseName}-copy${copyNumber === 1 ? '' : `-${copyNumber}`}`;\n\t\t\t\t\t\tcopyNumber++;\n\t\t\t\t\t\tcontinue;","sourceCodeStart":626,"sourceCodeEnd":662,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/ElementInstallConfirmation.tsx#L626-L662","documentation":"After installing an Element in the Studio's ElementInstallConfirmation flow, the install result is checked: if result.success is false, the thrown error is the plan/installer's own failure reason string (result.reason). This surfaces the underlying install error to the user.","triggerScenarios":"The element installation pipeline returns {success: false, reason} — e.g. invalid element package, file generation failure, or composition generation canceled — and the confirmation component rethrows reason as an Error.","commonSituations":"Malformed or incompatible element definition; dependency install failing in the target project; name/plan conflicts detected by the planner; disk or file-write failures during scaffold.","solutions":["Read the thrown reason message to identify the underlying install failure and fix that root cause","Retry the element install after correcting the element definition/package","Ensure the target project's files/compositions are writable and not locked by other processes","Validate the element package structure before installing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  await runElementInstall();\n} catch (e) {\n  // e.message is result.reason from the installer; show it to the user\n  showErrorNotification((e as Error).message);\n}","preventionTips":["Validate element packages before installation","Keep target project files writable and free of conflicts","Surface installer reasons in UI instead of failing silently"],"tags":["studio","elements","install","propagated-error"],"backgroundTag":"upstream-api-error","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"}