gitbutlerapp/gitbutler · error

Relaunch is not implemented in the web version

Error message

Relaunch is not implemented in the web version

What it means

webRelaunch is the web-platform stub for the desktop 'relaunch the app' backend call. It throws unconditionally because a page running in a browser cannot restart the application; the error fires whenever code written for the Tauri desktop shell invokes relaunch while running in the web build.

Solutions

  1. Gate relaunch UI and actions behind a platform check (desktop vs web) so the web build never calls webRelaunch
  2. Catch the error and tell the user to reload the page, since a browser reload is the web equivalent of a relaunch
  3. If relaunch is not critical on web, make webRelaunch a no-op or call location.reload() instead of throwing
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at apps/desktop/src/lib/backend/web.ts:174 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/c530a67e2a69a5c4. Report an issue: GitHub.

Appendix: source

Thrown at apps/desktop/src/lib/backend/web.ts:174

			}

			if (options?.multiple) {
				resolve(paths as OpenDialogReturn<T>);
				return;
			}

			const filePath = paths[0];
			resolve(filePath as OpenDialogReturn<T>);
		};
	});

	fileInput.click();
	return await promise;
}

async function webRelaunch(): Promise<void> {
	// The web version does not support relaunching
	throw new Error("Relaunch is not implemented in the web version");
}

/**
 * Invokes a backend web command via HTTP POST and returns the result.
 *
 * @template T The expected type of the response subject.
 * @param command - The name of the backend command to invoke.
 * @param params - An optional object containing parameters for the command.
 * @returns A promise that resolves with the subject of the response if successful.
 * @throws Throws an error if the backend responds with an error or if the request fails.
 */
async function webInvoke<T>(command: string, params: Record<string, unknown> = {}): Promise<T> {
	try {
		const response = await fetch(`${getApiBaseUrl()}/${command}`, {
			method: "POST",
			headers: {
				"Content-Type": "application/json",
			},

View on GitHub (pinned to 58e5313667)