You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use Create React App as part of an asset pipeline in a web framework (in my case Phoenix). As part of the development pipeline, I've set up a watcher to run react-scripts start whenever my web server starts.
This works fine, but whenever I terminate my web server, Webpack dev server remains running in the background. I want Webpack dev server to listen on stdin for SIGINT and SIGTERM so it can terminate itself.
I noticed in start.js that there is an event listener set up for SIGINT and SIGTERM, but this didn't work for me.
Referring to this documentation, I can fix the issue on my machine by adding this line;
process.stdin.resume()
before any of the process event handlers are added. I think process will exit prematurely and not listen to stdin without that.
If this works for everyone, I'd be happy to put in a PR.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
A similar story happened in rollup. It watched stdin, then process.stdin.resume() was removed in rollup/rollup#2410, but then added back in rollup/rollup#3493.
Describe the bug
I use Create React App as part of an asset pipeline in a web framework (in my case Phoenix). As part of the development pipeline, I've set up a watcher to run
react-scripts start
whenever my web server starts.This works fine, but whenever I terminate my web server, Webpack dev server remains running in the background. I want Webpack dev server to listen on stdin for SIGINT and SIGTERM so it can terminate itself.
I noticed in start.js that there is an event listener set up for SIGINT and SIGTERM, but this didn't work for me.
Referring to this documentation, I can fix the issue on my machine by adding this line;
before any of the process event handlers are added. I think process will exit prematurely and not listen to stdin without that.
If this works for everyone, I'd be happy to put in a PR.
Did you try recovering your dependencies?
Yes.
Which terms did you search for in User Guide?
Start, listen, stdin, sigint, and sigterm.
Environment
Steps to reproduce
Described above.
Expected behavior
react-scripts start
should listen to stdin for SIGINT and SIGTERM and terminate itself.Actual behavior
Webpack dev server keeps running in the background after its spawning process gets terminated.
The text was updated successfully, but these errors were encountered: