{"record":{"id":"576e76330499256a","repo":"gitbutlerapp/gitbutler","slug":"webreadfile-is-not-implemented-for-the-web-version","errorCode":null,"errorMessage":"webReadFile is not implemented for the web version","messagePattern":"webReadFile is not implemented for the web version","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/src/lib/backend/web.ts","lineNumber":241,"sourceCode":" */\nfunction webListen<T>(event: EventName, handle: EventCallback<T>) {\n\tconst webListener = WebListener.getInstance();\n\treturn webListener.listen({ name: event, handle });\n}\n\nasync function webCheckUpdate(): Promise<null> {\n\t// TODO: Implement this for the web version if needed\n\treturn null;\n}\n\nasync function webCurrentVersion(): Promise<string> {\n\t// TODO: Implement this for the web version if needed\n\treturn \"0.0.0\";\n}\n\nasync function webReadFile(_path: string): Promise<Uint8Array> {\n\t// TODO: Implement this for the web version if needed\n\tthrow new Error(\"webReadFile is not implemented for the web version\");\n}\n\nasync function webOpenExternalUrl(href: string): Promise<void> {\n\twindow.open(href, \"_blank\");\n\treturn await Promise.resolve();\n}\n\nclass WebListener {\n\tprivate socket: ReconnectingWebSocket | undefined;\n\tprivate count = 0;\n\tprivate handlers: { name: EventName; handle: EventCallback<any> }[] = [];\n\tprivate static instance: WebListener | undefined;\n\n\tprivate constructor() {}\n\n\tstatic getInstance(): WebListener {\n\t\tif (!WebListener.instance) {\n\t\t\tWebListener.instance = new WebListener();","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/apps/desktop/src/lib/backend/web.ts#L223-L259","documentation":"webReadFile is the web-build stub for reading a file from disk. Browsers cannot access arbitrary filesystem paths, so this TODO placeholder throws unconditionally; it fires whenever desktop-oriented code attempts to read a local file while running in the web version.","triggerScenarios":"Thrown at apps/desktop/src/lib/backend/web.ts:241 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Guard call sites with a platform check so filesystem reads are only attempted in the desktop build","Catch the error and surface a 'file access is not available in the web version' message","If the feature is needed on web, obtain file bytes via a file picker or a backend HTTP endpoint instead of a local path"],"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"}