GoLand 2024.1 Help

Debugging the server- and the client-side code

With GoLand, you can debug the server-side code of a Node.js application together with its client-side JavaScript code. To do that, you need to create a separate JavaScript Debug configuration in addition to the Node.js configuration and run these two configurations together. You can do that in two ways:

  • Create a JavaScript Debug configuration from the Edit Configurations dialog (Run | Edit Configurations) and then click the Run toolbar button to start it. For more information, refer to Debugging an application running on an external web server.

  • Create a JavaScript Debug configuration from the Live Edit tab when creating or editing a Node.js configuration. In this case, the JavaScript Debug configuration will start automatically every time you start the Node.js configuration.

Create a JavaScript Debug configuration from the Node.js configuration

  1. From the list in the Run widget, select the Node.js run configuration to start together with a JavaScript Debug configuration. Then click the More button and select Edit from the menu.

    Select a Node.js run/debug configuration from the Run widget

    Alternatively, create a Node.js run configuration, as described in Create a Node.js run/debug configuration.

  2. The dialog that opens shows the settings of the selected Node.js run/debug configuration. Switch to the Browser / Live Edit tab.

    Run/Debug configurations: Node.js dialog, switch to the Browser/Live Edit tab
  3. In the Browser / Live Edit tab, select After launch to start a browser automatically when you launch a debugging session. In the field below, type the URL address to open the application at.

    Choose the browser to use from the list next to the After launch checkbox.

    • To use the system default browser, select Default.

    • To use a custom browser, select it from the list. Note that debugging of JavaScript client-side code is only supported in Google Chrome and in other Chromium-based browsers.

    • To configure browsers, click the Browse button and adjust the settings in the Web Browsers and Preview dialog that opens. For more information, refer to Web browsers.

    Select the With JavaScript debugger checkbox.

    Node.js run/debug configuration: Browser/Live Edit tab
Last modified: 10 May 2024