-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Restarting Debugger Failing to Kill Nodemon #56756
Comments
(Experimental duplicate detection) |
Please note also that if you quit VS Code after launching nodemon-hosted processes and don't stop them all manually in each process terminal with Cntrl-C you will find orphaned Node processes in Activity Monitor still running and consuming CPU after VS Code has stopped. These can of course be manually force-quit in Activity Monitor. I have requested an update for tasks to allow automatic process clean-up via a task (#65986). But "proper" support for nodemon such that Debug Stop and Debug Restart kill all relevant processes is the best solution assuming this is possible. For reference, I use compound of launch configs that look like below.
|
This really needs to be fixed, asap. In my case, if I forget to manually kill the orphaned nodemon processes, they will eventually get stuck in a loop and start consuming 100% CPU. It's a major problem, and one that makes development using nodemon completely impractical. Please find a way to automatically and reliably kill nodemon when debugging is stopped. |
Wait a second - it actually looks like I have some success with the When that argument is specified, it actually looks like the nodemon process is killed when debugging is stopped or restarted 🎉 If that's really all it takes, the documentation here should probably be updated to mention that, instead of the current tip, which suggests that we must manually kill the orphaned nodemon processes. |
Great posts @thomas-darling. However the next problem I have then is that 'Restart Debugging' generally opens a new integrated terminal (only sometimes reuses an existing terminal) and since I run a compound debug config (multiple processes) I end up with multiple abandoned terminals with last line showing "[nodemon] app crashed". This problem would be solved I believe by the ability to specify the (As a side note, right now for me I can't use nodemon and integrated terminals at all (!) due to #71850 😟. But I hope that will get resolved not too long away.) |
I have a different issue even while nodemon if I save a file the server restarts but after that 2 processes with You can see in the screenshot there are 3 node processes, the bottom one is the actual process which is running the server, which has quite low CPU usage. Here is the screenshot of the integrated terminal showing the debugger port: Launch config: {
"name": "Launch Nodemon in Debug Mode",
"type": "node",
"request": "launch",
"runtimeExecutable": "npx",
"program": "${workspaceFolder}/build/app.js",
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeArgs": [
"nodemon",
"--nolazy",
"--exitcrash"
],
"env": {
"NODE_ENV": "development",
"NEW_RELIC_ENABLED": "false",
},
"console": "integratedTerminal",
"outFiles": [
"${workspaceRoot}/**/*.js"
],
"sourceMaps": true,
"protocol": "inspector",
"restart": true
} |
We since have a new debugger that handles child processes and trees like Nodemon in a more reliable way. Please let us know if you're still running into problems, and if so open an issue on that repo. |
Steps to Reproduce:
fn + F5
When i see in the integrated terminal it show me up
My launch configuration
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: