SAP Business Application Studio has built-in debugging support for the Node.js runtime and can debug JavaScript, TypeScript, or any other language that gets transpiled to JavaScript.
-
Open the Debug view.
-
From the dropdown list, select Add Configuration.
A list of configuration options is displayed.
-
Select Node.js. A launch configuration file (
launch.json
) is created automatically. You can configure and save debugging setup details in this file.- Launch Program
- Create JavaScript Debug Terminal
- Run Current File
-
To add a new configuration to an existing
launch.json
, from the dropdown list, select Add Configuration. -
From the dropdown list, select Run Current File or Launch Program (which provides you the option to skip node internal files).
You can run your configuration through the command palette, by filtering on Debug: Start Debugging.
Note that the attributes available in launch configurations vary from debugger to debugger.
There are two core debugging modes, Launch and Attach.
The debugger can launch a program in debug mode, or it can attach to an already running program in debug mode.
You can trigger these modes from the command palette: Debug : Attach to Node Process
Breakpoints can be toggled by clicking on the editor margin or using [F9] on the current line.
You can also use the BREAKPOINTS section.
- Click to add a function breakpoint.
- Click to deactivate a breakpoint.
- Click to remove all breakpoints.