Debugging of Node.js®

In order to debug TypeScript/JavaScript code, the debugging mode of the WinCC OA JavaScript Manager for Node.js can be enabled by setting a manager option, which in turn enables an interface to attach to the manager by regular TypeScript/JavaScript debugging tools.

Activate Node.js® Debugging

Following steps must be performed to debug TypeScript-JavaScript:

  1. Add the command line parameter --inspect to the WinCC OA JavaScript Manager for Node.js. This parameter is passed to Node.js® and must therefore be listed at the top of the parameters, see also Syntax Manager Options.
  2. Restart the manager.
  3. Open the debugging tool of your choice, for example: Google Chrome or Microsoft VS Code.
  4. Connect to the node instance of the WinCC OA JavaScript Manager for Node.js

    Google Chrome: Open the browser and enter the following URL in the address bar:

    chrome://inspect

    Within the opened page you can now select the desired Node instance, as well as using the link Open dedicated DevTools for Node to open an additional window with the debugging tools.

    VS Code: Open the Command Palette (SHIFT + CTRL + P) and enter following command:

    Debug: Attach to Node Process

    You can then choose from a list of available instances on your computer to connect.