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
Programmatically trying to kill the "yarn start" process only kills some of the relevant processes. In particular, the node sub-process that listens to port 3000 is left running, which in turn causes trouble on the next "yarn start" attempt.
Did you try recovering your dependencies?
Bug happens when running "yarn start" from fresh "npx create-react-app", so this should not be relevant.
Which terms did you search for in User Guide?
Tried searching for "stop", to see if there was some documented way of stopping the thing you start with "yarn start", but found nothing.
Environment
Environment Info:
current version of create-react-app: 4.0.3
running from /Users/hmeland/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app
System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 16.6.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.19.1 - /usr/local/bin/npm
Browsers:
Chrome: 92.0.4515.107
Edge: Not Found
Firefox: Not Found
Safari: 14.1.2
npmPackages:
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-scripts: 4.0.3 => 4.0.3
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
To reproduce (I'm on OSX, don't know whether other OSes are also affected):
$ npx create-react-app repro
$ cd repro/
$ yarn
$ yarn start &
[1] 94708
# Now, wait for browser page to open and start working...
$ pstree 94708
-+= 94708 hmeland node /usr/local/Cellar/yarn/1.22.10/libexec/bin/yarn.js start
\-+- 94730 hmeland /usr/local/Cellar/node/16.6.0/bin/node /private/tmp/repro/node_modules/.bin/react-scripts start
\--- 94731 hmeland /usr/local/Cellar/node/16.6.0/bin/node /private/tmp/repro/node_modules/react-scripts/scripts/start.js
$ sudo lsof -i :3000 | grep LISTEN
node 94731 hmeland 27u IPv4 0xe4aa337aee33c393 0t0 TCP *:hbci (LISTEN)
# Note that the process listening to port 3000 (pid 94708)
# is not the master "yarn start" process (pid 94731)
# If we had run "yarn start" in the foreground, and quit it with
# Control-C, that ends up killing both all of the relevant processes.
# However, I'm trying to script starting/stopping the development
# web server in concert with my backend service, so naively I only
# have the master "yarn start" process to work with (unless I want
# to put my hands into a hornets' nest of OS-specific
# workarounds).
$ kill 94708
[1]+ Terminated: 15 yarn start
$ pstree 94708
# No output, as the parent process has been killed
# ... but the listening node subprocess is still running:
$ sudo lsof -i :3000 | grep LISTEN
node 94731 hmeland 27u IPv4 0xe4aa337af94349b3 0t0 TCP *:hbci (LISTEN)
Expected behavior
Killing the parent process should also cause the listening sub-process to get killed.
Actual behavior
(Write what happened. Please add screenshots!)
Reproducible demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered:
@razwanizmi I have tried your suggested fix (Sorry for the slow response), but it does not fix my issue.
If I try reproducing my issue as originally described, I end up with a parent process that gets "stopped" because it is unable to read from stdin, but I think that is more an artifact of my attempted shell reproduction of the issue than the issue itself.
By modifying my reproduction steps to do "yarn start < /dev/null &" instead of just "yarn start &", I still see the same parent-process-gets-killed-but-sub-sub-process-which-is-actually-listening-to-port-3000-sticks-around behaviour that I originally described.
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.
Describe the bug
Programmatically trying to kill the "yarn start" process only kills some of the relevant processes. In particular, the node sub-process that listens to port 3000 is left running, which in turn causes trouble on the next "yarn start" attempt.
Did you try recovering your dependencies?
Bug happens when running "yarn start" from fresh "npx create-react-app", so this should not be relevant.
Which terms did you search for in User Guide?
Tried searching for "stop", to see if there was some documented way of stopping the thing you start with "yarn start", but found nothing.
Environment
Environment Info:
current version of create-react-app: 4.0.3
running from /Users/hmeland/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app
System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 16.6.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.19.1 - /usr/local/bin/npm
Browsers:
Chrome: 92.0.4515.107
Edge: Not Found
Firefox: Not Found
Safari: 14.1.2
npmPackages:
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-scripts: 4.0.3 => 4.0.3
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
To reproduce (I'm on OSX, don't know whether other OSes are also affected):
Expected behavior
Killing the parent process should also cause the listening sub-process to get killed.
Actual behavior
(Write what happened. Please add screenshots!)
Reproducible demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered: