skellock / typescript-with-electron-react-kit

Don't just start your Electron app... TWERKit.
https://skellock.github.io/typescript-with-electron-react-kit
MIT License
145 stars 23 forks source link

Dev Port not being released? #96

Open nolawnchairs opened 7 years ago

nolawnchairs commented 7 years ago

Each time I close the application window, I cannot relaunch (using npm start), as I get this error:

Error: listen EADDRINUSE 0.0.0.0:4925 at Object.exports._errnoException (util.js:1020:11) at exports._exceptionWithHostPort (util.js:1043:20) at Server._listen2 (net.js:1262:14) at listen (net.js:1298:10) at net.js:1408:9 at _combinedTickCallback (internal/process/next_tick.js:83:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9)

I can launch again by changing the port number in fuse.ts, but it's not convenient to change this every time I need to close and re-open the window while testing.

I also notice that everything you build is VERY mac-exclusive (I am developing on a Windows 10 machine), including the scripts in the package.json file - perhaps this error I'm getting is somehow caused by some unix command instead of a win32 command?

Any clues?

skellock commented 7 years ago

Ya that's strange. Sounds like those dev server processes aren't getting closed when you close that window.

Can you close the running dev server safely first somehow? Click control-c or something?

nolawnchairs commented 7 years ago

Closing the dev server (Control-C) works as expected, subsequent launches are successful. Perhaps if you could tell me where and how the shutdown is handled when closing the window, (when the port is closed) I could see if anything jumps out at me as something mac-specific that may be causing issues on a PC.

skellock commented 7 years ago

That functionality is handled by fusebox. They spin up the dev server.