question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node.js processes *still* don't quit after stopping debugging

See original GitHub issue

Describe the bug

The same issue as #5204, many nodejs instances continue to run after debugging an ASP.NET Core application.

Currently, I am using taskkill.exe /F /IM node.exe /T to shut down instances after each debugging session to mitigate this. Here’s a screenshot showing 18 nodejs processes running (all children of VS.NET) after debugging:

image

One (or more) of these is typically (but not always) consuming a large amount of CPU.

It tends to slow down performance on my machine quite a bit after this.

To Reproduce

This is an ASP.NET Core React SPA application that was created with the template ~ASP.NET Core 2.1. It’s been upgraded over time and is currently on ASP.NET Core 5.0.

Debugging occurs in VS.NET 2022.

I do have a private github repo that I’m willing to share privately to assist.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
casperOnecommented, Dec 8, 2021

@mkArtakMSFT @javiercn @TanayParikh I have a minimal example here

https://github.com/casperOne/asp-net-core-react-spa-note-wont-shut-down

It’s my project, reduced to bare bones that sets up the ASP.NET Core side, displaying “Hello there” through React.

I’ve confirmed that the behavior with orphaned nodejs processes occurs with this example.

Note: You’ll have to run yarn install in the ClientApp directory to initialize the node_modules directory before debugging.

1reaction
msftbot[bot]commented, Dec 8, 2021

Thanks for contacting us.

We’re moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it’s very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js processes don't quit after stopping debugging #5204
Another workaround is to launch app in external command line window and after stopping debug, as this window is still on, I can...
Read more >
VS Code Debugger does not kill node process after ...
I am working on a node.js application using express.js as a web framework listening on PORT 3000. I am using VS Code v1.46....
Read more >
Stop debugging web sites do not terminate node.js ...
Stop the debugging and see in the Task manager again. The two scripts mentioned are still running and continue to consume CPU resources...
Read more >
VS2019 doesn't stop node.exe after stop debugging
Press F5 to debug the project. Take a look at Task Manager, there will be 3 node.exe process; Stop debugging; See Task Manger...
Read more >
Stopping debugger in nodejs run configuration does not clean ...
Stopping debugger in nodejs run configuration does not clean up child processes.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found