{"record":{"id":"c530a67e2a69a5c4","repo":"gitbutlerapp/gitbutler","slug":"relaunch-is-not-implemented-in-the-web-version","errorCode":null,"errorMessage":"Relaunch is not implemented in the web version","messagePattern":"Relaunch is not implemented in the web version","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/src/lib/backend/web.ts","lineNumber":174,"sourceCode":"\t\t\t}\n\n\t\t\tif (options?.multiple) {\n\t\t\t\tresolve(paths as OpenDialogReturn<T>);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst filePath = paths[0];\n\t\t\tresolve(filePath as OpenDialogReturn<T>);\n\t\t};\n\t});\n\n\tfileInput.click();\n\treturn await promise;\n}\n\nasync function webRelaunch(): Promise<void> {\n\t// The web version does not support relaunching\n\tthrow new Error(\"Relaunch is not implemented in the web version\");\n}\n\n/**\n * Invokes a backend web command via HTTP POST and returns the result.\n *\n * @template T The expected type of the response subject.\n * @param command - The name of the backend command to invoke.\n * @param params - An optional object containing parameters for the command.\n * @returns A promise that resolves with the subject of the response if successful.\n * @throws Throws an error if the backend responds with an error or if the request fails.\n */\nasync function webInvoke<T>(command: string, params: Record<string, unknown> = {}): Promise<T> {\n\ttry {\n\t\tconst response = await fetch(`${getApiBaseUrl()}/${command}`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t},","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/apps/desktop/src/lib/backend/web.ts#L156-L192","documentation":"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.","triggerScenarios":"Thrown at apps/desktop/src/lib/backend/web.ts:174 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Gate relaunch UI and actions behind a platform check (desktop vs web) so the web build never calls webRelaunch","Catch the error and tell the user to reload the page, since a browser reload is the web equivalent of a relaunch","If relaunch is not critical on web, make webRelaunch a no-op or call location.reload() instead of throwing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}