Bird
0
0

Why might VS Code's debugger not stop at breakpoints in a Node.js app even though the breakpoints appear active?

hard📝 Conceptual Q10 of 15
Node.js - Debugging and Profiling
Why might VS Code's debugger not stop at breakpoints in a Node.js app even though the breakpoints appear active?
AThe Node.js process was started without the --inspect flag or equivalent debug option
BThe breakpoints are set on empty lines
CThe source code is minified and not mapped correctly
DThe launch.json file is missing
Step-by-Step Solution
Solution:
  1. Step 1: Understand debugger connection requirements

    Node.js must be started with debugging enabled (e.g., --inspect flag) for VS Code to attach and stop at breakpoints.
  2. Step 2: Consider other causes

    Breakpoints on empty lines are ignored but usually not shown active. Minified code can cause mapping issues but breakpoints usually still stop. Missing launch.json prevents configuration but VS Code can attach manually.
  3. Final Answer:

    The Node.js process was started without the --inspect flag or equivalent debug option -> Option A
  4. Quick Check:

    Debugger needs --inspect flag to stop at breakpoints [OK]
Quick Trick: Start Node.js with --inspect to enable debugging [OK]
Common Mistakes:
  • Ignoring need for --inspect flag
  • Setting breakpoints on empty lines
  • Assuming launch.json absence blocks breakpoints

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes