remotion-dev/remotion · error

${result.reason}

Error message

${result.reason}

What it means

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.

Source

Thrown at packages/studio/src/components/ElementInstallConfirmation.tsx:644

			let copyNumber = 1;
			while (true) {
				const result = await prepareElementInstall({
					installationName: candidate,
					destination:
						mode === 'current-composition'
							? {
									type: 'current-composition',
									compositionFile: request.compositionFile,
									compositionId: request.compositionId,
								}
							: {
									type: 'new-composition',
									compositionFile: selectedPlan.compositionFile,
								},
					element: request.element,
				});
				if (canceled) return;
				if (!result.success) throw new Error(result.reason);

				const prepared = {
					basePlan: selectedPlan,
					name: candidate,
					refresh: refreshPlan,
					plan: result.plan,
				};
				if (result.plan.expectedFileState.exists) {
					setExistingInstallation((previous) =>
						previous?.basePlan === selectedPlan &&
						previous.refresh === refreshPlan
							? previous
							: prepared,
					);
					if (requestedName === null) {
						candidate = `${elementBaseName}-copy${copyNumber === 1 ? '' : `-${copyNumber}`}`;
						copyNumber++;
						continue;

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Read the thrown reason message to identify the underlying install failure and fix that root cause
  2. Retry the element install after correcting the element definition/package
  3. Ensure the target project's files/compositions are writable and not locked by other processes
  4. Validate the element package structure before installing
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

try {
  await runElementInstall();
} catch (e) {
  // e.message is result.reason from the installer; show it to the user
  showErrorNotification((e as Error).message);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-09-09). Data as JSON: /api/errors/5719faa38f67458f. Report an issue: GitHub.