GoLand 2019.2 Help

Debugging the server- and the client-side code

With GoLand, you can debug the server-side code and the client-side JavaScript code of your application in two modes:

  • Separately, using single-run configurations.

  • Simultaneously, using a complex Node.js with JavaScript Debug configuration. All you need is configure the behaviour of the browser and enable debugging the client-side code of the application. This functionality is provided through a JavaScript Debug run configuration, so technically, GoLand creates separate run configurations for the server-side and the client-side code, but you specify all your settings in one dedicated Node.js run configuration.

Create a compound Node.js/JavaScript Debug configuration

  1. From the main menu, select Run | Edit Configuration.

  2. From the list, select the Node.js run configuration to start together with a JavaScript Debug configuration. In the dialog that opens, switch to the Browser / Live Edit tab.

  3. Select After launch to start a browser automatically when you launch a debugging session.

  4. In the field below, type the URL address to open the application at.

  5. 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 Live Edit is fully supported only in Chrome.

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

  6. Select With JavaScript debugger.

As for any other JavaScript debugging session, you can enable the Live Edit functionality as described in Live_Editing.

Enable Live Edit in a Node.js application

  1. Install the LiveEdit plugin on the Plugins page as described in Managing plugins.

  2. In the Settings/Preferences dialog (Ctrl+Alt+S), click Debugger under Build, Execution, Deployment, and then click Live Edit. The Live Edit page opens.

  3. Select Update Node.js application on changes. Specify the time-delay between changing the code in the editor and showing this change in the browser: accept the default value 300 ms or specify a custom value using the spin box next to the corresponding field.

Last modified: 29 October 2019