Skip to content

Conversation

@nicholaspsmith
Copy link

@nicholaspsmith nicholaspsmith commented Dec 26, 2025

Summary

This PR fixes an issue that prevented the application from running properly in development mode on my machine (macos Tahoe 26.1)

Problems Addressed

Blank Electron Window Issue
When running npm run dev, the Electron window would open but display completely blank. The root cause was a race condition where:

  • Vite dev server and Electron were starting simultaneously
  • Both processes competed for port 5173
  • Electron would load before Vite was ready, resulting in a failed page load

Solutions Implemented

1. Configure Vite with Strict Port Binding (vite.config.js)

  • Added port: 5173 and strictPort: true to the Vite server configuration
  • Ensures Vite fails immediately if the port is already in use

2. Implement Sequential Startup (package.json)

  • Installed wait-on package as a dev dependency
  • Updated dev:all script to ensure Vite starts before Electron:
    concurrently -k ... "npm run dev:svelte" "wait-on http://localhost:5173 && npm run dev:electron"
    
  • This guarantees the Vite dev server is fully ready before Electron attempts to connect

Testing

  • Verified npm run dev now starts without port conflicts
  • Confirmed Electron window displays properly with the UI rendered
  • Tested that the application functions correctly in dev mode

Files Changed

  • vite.config.js - Added port and strictPort configuration
  • package.json - Added wait-on dev dependency and updated dev:all script
  • package-lock.json - Updated lock file to include wait-on package

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.

1 participant