This is a DAP-based JavaScript debugger. It debugs Node.js, Chrome, Edge, WebView2, VS Code extensions, Blazor, React Native, and more. It is the default JavaScript debugger in Visual Studio Code and Visual Studio, and the standalone debug server can also be used in other tools such as nvim. UsageIf you're using Visual Studio or Visual Studio Code, See OPTIONS.md for a list of options you can use in your launch configurations.
Nightly ExtensionThe shipped version of VS Code includes the js-debug version at the time of its release, however you may want to install our nightly build to get the latest fixes and features. The nightly build runs at 5PM PST on each day that there are changes (see pipeline). To get the build:
Notable FeaturesIn Debug child processes, web workers, service workers, and worker threadsIn Node.js, child processes and worker threads will automatically be debugged. In browsers, service workers, webworkers, and iframes will be debugged as well. While debugging workers, you can also step through PreviewDebug WebAssembly with DWARF symbolsThe debugger automatically reads DWARF symbols from WebAssembly binaries, and debugs them. The usual debugging features are available, including limited evaluation support via PreviewDebug Node.js processes in the terminalYou can debug any Node.js process you run in the terminal with Auto Attach. If auto attach isn't on, you can run the command PreviewOnce enabled, you can toggle Auto Attach by clicking the Profiling SupportYou can capture and view performance profiles natively in VS Code, by clicking on the ⚪ button in the Call Stack view, or through the We support taking and visualizating CPU profiles, heap profiles, and heap snapshots. PreviewInstrumentation breakpointsWhen debugging web apps, you can configure instrumentation breakpoints from VS Code in the "Event Listener Breakpoints" view. PreviewReturn value interceptionOn a function's return statement, you can use, inspect, and modify the PreviewNote that you can use and modify properties on the Pretty-print minified sourcesThe debugger can pretty print files, especially useful when dealing with minified sources. You can trigger pretty printing by clicking on the braces PreviewExperimental Network ViewThe debugger allows viewing network traffic of browser targets and Node.js >22.6.0. This requires enabling the PreviewAdvanced Rename SupportWhen using a tool that emits renames in its sourcemap, the debugger maps renamed variables in all displayed views, and also rewrites evaluation requests to use the renamed identifiers, allowing near-source-level debugging of minified code. Conditional Exception BreakpointsAs in most debuggers, you can pause on caught exceptions, but you can also filter the exceptions you want to pause on by checking against the PreviewExcluded CallersIf you have a breakpoint you want to pause on, but not when called from certain frames, you can right click on call frames in the stack trace view to "exclude caller" which prevents pausing on that breakpoint when the requested caller is in the stack trace. PreviewStep-in TargetsWhen paused on a location with multiple calls or expressions, the debugger supports the Debug: Step Into Target action that allows you to request a specific expression you wish to step into. |