Quramy / electron-connect

Livereload tool for Electron
https://www.npmjs.com/package/electron-connect
340 stars 54 forks source link

electron.restart blocked on before-quit task #58

Open yannbertrand opened 8 years ago

yannbertrand commented 8 years ago

I have set up a project where I use electron-connect in a gulpfile. Whenever I do modifications inside my electron server I call the electron.restart task.

I've added listeners on electron's before-quit, will-quit and quit events to log when they're called. When I quit my app with a SIGKILL (ctrl+c) in my terminal, everything just works as excepted (before-quit -> will-quit -> quit). However when I update a server-side file, only the before-quit event is called and I need to quit the app itself to continue the process and restart the app.

I'm not sure where that comes from..

ssreekanth commented 8 years ago

@YannBertrand could you share your sample code to help us recreate the issue and debug it? Github gist or repo with sample code would be great.

yannbertrand commented 8 years ago

Here you go! https://gist.github.com/YannBertrand/99e3c2c171337cbae405f5d6d48fa732

It seems that it comes from Socket.io. When I remove the script inside the index.html, it works.

xingyuzhe commented 8 years ago

i got the same problem. when i use electron-connect without watch files with babel compile, everything goes ok. but once i add babel compile to files, electron.restart blocked on before-quit task. When i remove the code require('electron-connect').client.create(window), electron.restart don't block, but it start the electron each time but not restart it,