17

I am working on this node.js application using Visual Studio Code IDE. Everytime I run this application, it is attaching a debugger (which takes around 2-5 seconds) and then executing the application.

So, my issue is everytime if I modify some code (or a simple variable name) and execute the program, it takes this much time to see the output even though I haven't set any breakpoints.

Need help in disabling the debugger in Visual Studio Code IDE for node applications development. I can't find anything helpful on net :( .

5 Answers 5

11

Inside the VsCode terminal, I've switched the terminal to zsh instead of the JS Debug Console and it fixed it:

Screenshot of the terminal's dropdown

Sign up to request clarification or add additional context in comments.

Comments

9

There is workbench.action.debug.run which is bound to cmd+f5 / ctrl+f5 by default.

You can find it in the command palette under the name "Debug: Start without Debugging"

5 Comments

I press F5 to start the application which, of course, triggers the 'start of debug panel'. Is there no way to modify launch.json and achieve my aim?
Ok, you got me, I search around and found github.com/Microsoft/vscode/issues/2780 where this "feature" is discussed. Its useful, but still sounds kinda wrong to "debug without debugging". Updated my answer ;)
Is there any option to directly execute instead of debug from launch.json?
That's what the command does, the debugger skips what it would normally do and "node --nolazy app.js" gets started in the background, no debugger gets attached. You still need the setup via launch.json though, if that is what you ask.
You rock. I have now interchanged the cmf+f5 with 'f5'. Now I can execute my node program hassle free and faster. Thanks. You saved my (2 to 5 seconds) * ∞ time. :)
5

You can just switch from "Javascript Debug Terminal" to "powershell" (command terminal). it doesn't attach the debugger again

Screenshot of the terminal

Comments

4

consider passing the option below on settings.json

"debug.javascript.autoAttachFilter": "onlyWithFlag"

with this option, you will always need to pass ---inspect option to start debugging mode. otherwise, it will always start normal running mode.

Comments

2

This is what worked for me:

  1. Press CTRL/CMD + Shift + P to open the command palette
  2. Search for Debug: Toggle Auto Attach
  3. Set to Disabled or Only with Flag

It somehow got set to Always (probably when I was messing with the debugger the other week). Changed to Only with Flag and now it's not automatically popping up each time.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.