csepulv / electron-with-create-react-app

Sample Electron application using create-react-app
MIT License
831 stars 217 forks source link

Error when quitting app #16

Closed nadangergeo closed 6 years ago

nadangergeo commented 6 years ago

Hi! Thank you for a great tutorial :)

When explicitly quiting the app, the web server is not killed and it throws and error. The same error is given when trying to start the app again ("killall node" resolves this). Any ideas what to do about this? Is this a problem when building the electron app for prod?

[DONE] Killing all processes with signal  null
internal/util.js:186
  throw new errors.TypeError('ERR_UNKNOWN_SIGNAL', signal);
  ^

TypeError [ERR_UNKNOWN_SIGNAL]: Unknown signal: null
    at convertToValidSignal (internal/util.js:186:9)
    at ChildProcess.kill (internal/child_process.js:396:5)
    at EventEmitter.<anonymous> (/Users/nadangergeo/Workspace/lek/korv/experiment2/node_modules/foreman/lib/proc.js:54:11)
    at EventEmitter.emit (events.js:164:20)
    at ChildProcess.<anonymous> (/Users/nadangergeo/Workspace/lek/korv/experiment2/node_modules/foreman/lib/proc.js:50:13)
    at ChildProcess.emit (events.js:159:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! korv@0.0.0 start: `nf start -p 3000`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the korv@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nadangergeo/.npm/_logs/2018-01-07T06_57_30_724Z-debug.log
csepulv commented 6 years ago

Are you starting with npm run dev and then killing from Electron directly? If so, it probably is upsetting foreman. You could kill from your console/terminal by hitting Ctrl-C so that foreman, which is managing the processes, can clean up.

In production, you wouldn't use foreman so I don't think this would be an issue.

Given the error message you noted, this is my best guess.

nadangergeo commented 6 years ago

Ah! Yes, ctrl-c made Foreman happier ^^ Makes sense now :) Thank you!

Cheers, Nadan Gergeo

On 7 Jan 2018, at 08:21, Christian Sepulveda notifications@github.com wrote:

Are you starting with npm run dev and then killing from Electron directly? If so, it probably is upsetting foreman. You could kill from your console/terminal by hitting Ctrl-C so that foreman, which is managing the processes, can clean up.

In production, you wouldn't use foreman so I don't think this would be an issue.

Given the error message you noted, this is my best guess.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.