Summary
apiFetch calls JSON.parse(response.body) before inspecting response.ok, so any non-JSON body (uvicorn plain-text 500, empty/truncated body) throws SyntaxError before the status is read, masking the real error and producing unhandled rejections. Also, FastAPI 422 detail is an array of objects, so new Error(data.detail) yields "[object Object]".
Location
electron/renderer/src/lib/api.ts:31-46
Notes
Also (L31-35): the non-Electron fallback hardcodes port 8000 and sends no Authorization header, so it can never work (backend binds an ephemeral port and mints a required token) - running the renderer in a plain browser tab breaks all data loading.
Fix
Check response.ok before parsing; parse detail arrays into a readable message; either fix or remove the non-Electron fallback.
Summary
apiFetchcallsJSON.parse(response.body)before inspectingresponse.ok, so any non-JSON body (uvicorn plain-text 500, empty/truncated body) throwsSyntaxErrorbefore the status is read, masking the real error and producing unhandled rejections. Also, FastAPI 422detailis an array of objects, sonew Error(data.detail)yields"[object Object]".Location
electron/renderer/src/lib/api.ts:31-46Notes
Also (L31-35): the non-Electron fallback hardcodes port
8000and sends noAuthorizationheader, so it can never work (backend binds an ephemeral port and mints a required token) - running the renderer in a plain browser tab breaks all data loading.Fix
Check
response.okbefore parsing; parsedetailarrays into a readable message; either fix or remove the non-Electron fallback.