Skip to content

Fix Windows desktop API offline / Failed to fetch - #25

Merged
Modsofthenation merged 2 commits into
mainfrom
cursor/fix-windows-api-fetch-e5b1
Jul 26, 2026
Merged

Modsofthenation merged 2 commits into
mainfrom
cursor/fix-windows-api-fetch-e5b1

Conversation

@Modsofthenation

@Modsofthenation Modsofthenation commented Jul 26, 2026 •

Copy link
Copy Markdown
Owner

Problem

Packaged Windows builds show API offline with Failed to fetch (and the web-dev hint to run pnpm dev:api). The UI loads, but the webview cannot reliably call the Node sidecar on http://127.0.0.1:8787 (spawn/CORS/cross-origin fetch issues).

Fix

  1. Same-origin UI — copy apps/ui/dist → src-tauri/ui-dist, pass PRM_UI_DIR to the sidecar, serve static files from the API, and open the webview at http://127.0.0.1:8787/ so /api is same-origin.
  2. Windows spawn — CREATE_NO_WINDOW, append child stdio to desktop-api.log (no pipe deadlock), exe-relative sidecar discovery.
  3. Offline UI — desktop-specific copy + log path; Retry navigates to the API origin when healthy.
  4. CORS / scheme — allow *.localhost / tauri://; keep use_https_scheme(false).
  5. CI — smoke sidecar health + static / after each desktop matrix build.

Verify

  • Local: sidecar with PRM_UI_DIR returns /api/health and HTML for /.
  • After merge: download a new desktop-windows-x86_64 artifact from main CI (not a pre-fix build).
  • If still failing: check %APPDATA%\com.prm.workbench\desktop-api.log.

Notes

You are currently on a build that still shows the pnpm dev:api message (pre–desktop offline copy). This PR’s artifact will show a desktop-specific offline screen if the sidecar fails, or skip that screen entirely when same-origin load succeeds.

Open in Web Open in Cursor 

cursoragent and others added 2 commits July 26, 2026 00:01
Spawn Node with CREATE_NO_WINDOW, keep http://tauri.localhost (no mixed
content), broaden CORS for *.localhost, improve offline UI with log path,
and smoke-test the sidecar in CI.

Co-authored-by: Damon  <[email protected]>
Packaged builds now copy ui-dist into Tauri resources, pass PRM_UI_DIR to
the sidecar, and open the webview at http://127.0.0.1:8787/ so /api is
same-origin. Also harden Windows spawn logging and exe-relative sidecar
discovery.

Co-authored-by: Damon van der linde <[email protected]>
@cursor cursor Bot changed the title Harden Windows desktop API startup (Failed to fetch) Fix Windows desktop API offline / Failed to fetch Jul 26, 2026
@Modsofthenation
Modsofthenation merged commit e547532 into main Jul 26, 2026
2 checks passed
@cursor
cursor Bot deleted the cursor/fix-windows-api-fetch-e5b1 branch August 12, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants