Hey,
I'm hoping to get some help with a really confusing Windows-specific issue for my Tauri desktop app
The Architecture:
- Frontend: Next.js (statically exported with next build).
- Backend: A standalone Express.js server that handles a streaming API endpoint (/api/proxy-check).
- Packaging: I'm using esbuild to bundle the Express server into a single JS file, and then pkg to compile that into a standalone executable binary (server.exe for Windows).
The final server.exe is bundled as a sidecar using externalBin in my tauri.conf.json, and my app starts it using Command.sidecar in a React hook.
The Problem:
- On macOS: Everything works flawlessly. The app launches, the sidecar starts, the frontend connects to http://localhost:3001, and the API works.
- On Windows: This is where it gets weird.
- The app installs and launches correctly.
- My useApi hook successfully spawns the server.exe sidecar. I can see it running in the Task Manager.
- I can take the API URL (http://localhost:3001/api/proxy-check) and hit it with Postman on the same Windows machine, and it works perfectly. I get the correct streaming response.
- However, the fetch request from within the Tauri app itself fails. The DevTools console shows a TypeError: Load failed, which seems to be a generic network error.
This proves the server is running and functional, but something is specifically blocking the connection between the Tauri webview (WebView2 on Windows) and the localhost server.