I have a Node application that works fine when just run using npm run serve, and also when run using the Visual Studio debugger.

The only problem is that when I place breakpoints, the debugger instead of stopping at the line of code where I have the breakpoint placed, it stops in a line that is calling _runMicrotasks() in the file next_tick.js. If I have 4 breakpoints that is one after the other, then all the 4 times it stops in this same line that is calling _runMicrotaks() in the file next_tick.js instead of in the line of code where I had placed the breakpoint.

Technical Specifications: npm - 6.4.1, node - v8.12.0

Screenshot of the debugger when it stops at _runMicrotasks()


When facing with Debugger stopping at next_tick.js, add "/**" to skipFiles in launch.json Even after that if you don't see breakpoint, open call stack drop down in the debugger menu (in vscode) and select the top most call stack entry


I was finally able to find the solution to my own question. What basically was happening was, by default the call stack pointed to a level deeper than the top where I had actually placed the breakpoint. So instead of taking me to the breakpoint, it took me to a level deeper in the call stack.

The solution is simply to click on the top of the call stack in the debugger view on the side(refer screenshot).

How to make debugger go to the top of call stack

Additionally for subsequent breakpoints, if the debugger always stops at the next_tick.js file, then in the call stack in the debugger menu right click on the topmost entry and click on Toggle Skipping this File. This ensures that the debugger does not skip the top-level file where you have placed the breakpoint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.