-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle stdin closing #1753
Comments
Do you want to send a PR? |
Not sure if it helps anyone, but we recently fixed the same issue in webpack-dev-server. See here. I imagine the fix in CRA would look a lot like this. |
Hopefully this is fixed by #2246. |
|
I'm not OP but as far as I can tell #2246 does not solve this issue. This issue is about adding an option to create-react-app to terminate when stdin closes, not gracefully handling SIGINT and SIGTERM. For better or worse, listening for stdin closing is how Phoenix signals to its watcher processes that they should terminate The relevant code for webpack is here: if(watchOptions.stdin) {
process.stdin.on("end", function() {
process.exit(); // eslint-disable-line
});
process.stdin.resume();
} webpack/webpack-dev-server has an example for specifically this functionality: https://github.com/webpack/webpack-dev-server/tree/master/examples/cli-stdin
I see two solutions:
Happy to make a PR if desired |
Manually fixed in an ejected app by editing
@gaearon Can we please reopen this? It's not fixed at this time. |
Could you please send a pull request? |
This is still broken. The above PR is still open. |
Description
When running
react-script
from something like Phoenix, when you stop the phoenix process, thereact-script
process hangs around in the background. Brunch and webpack have both implemented this.Expected behavior
The process is stopped when stdin is closed.
Actual behavior
The process does not stop.
The text was updated successfully, but these errors were encountered: