IntelliJ IDEA 2018.3 Help

Configuring JavaScript Debugger

Debugging JavaScript in IntelliJ IDEA is supported through the JavaScript Debugger plugin. The plugin is activated by default. If the plugin is disabled, enable it on the Plugins settings page as described in Managing Plugins.

Debugging of JavaScript code is supported in Google Chrome and other browsers of the Chrome family.

To ensure successful debugging, it is enough to specify the built-in web server port and accept the default settings that IntelliJ IDEA suggests for other debugger options.

To set the built-in web server port

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), click Debugger under Build, Execution, Deployment. The Debugger page opens.

  2. In the Built-in server area, specify the port where the built-in web server runs. By default this port is set to the default IntelliJ IDEA port 63342 through which IntelliJ IDEA accepts connections from services. You can set the port number to any other value starting with 1024 and higher.

Optionally

  • Suppress calls to the files on the built-in server from other computers or from outside IntelliJ IDEA by clearing the Can accept external connections or Allow unsigned requests checkbox respectively.

  • Choose the way to remove breakpoints, the default setting is Click.

  • On the Data Views page under the Debugger node, configure advanced debugger options: enable or disable Inline Debugging, specify when you want to see tooltips with object values and expressions evaluation results, etc.

  • Click JavaScript under the Data Views node and on the JavaScript page that opens, specify the following:
    • Whether you want object node properties to be shown. If so, specify the properties. Use icons general add svg and icons general remove svg to manage the list of properties.

Starting a debugging session with your default Chrome user data

You may notice that your debugging session starts in a new window with a custom Chrome user data instead of your default one. As a result, the window looks unusual, for example, your bookmarks, the browser history, and the extensions are missing, which altogether breaks your development experience. That happens because IntelliJ IDEA uses Chrome Debugging Protocol and runs Chrome with the --remote-debugging-port option. However, if Chrome is already started, a debugging port can't be opened for any new or existing Chrome instance that has the same user data. Therefore, when Chrome Debugging Protocol is used, IntelliJ IDEA always starts a debugging session with in a new window with a custom user data.

Summary

  • To start a debugging session in the same Chrome instance, use the JetBrains Chrome extension as you did before.

  • To open a new Chrome instance with your familiar look-and-feel, configure Chrome in IntelliJ IDEA to start with your user data. In this case, before starting a debugging session, always make sure that Chrome is not already running with your user data. Otherwise IntelliJ IDEA still launches another instance of Chrome with your user data but is unable to open a debugging port for it. As a result, IntelliJ IDEA debugger fails to connect to the application in the new Chrome instance and the debugging session does not start.

To configure Chrome in IntelliJ IDEA to start with your Chrome user data

  1. Save your Chrome user data anywhere on your machine.

  2. In the Settings/Preferences dialog (Ctrl+Alt+S), click Web Browsers under Tools. The Web Browsers page opens.

  3. To create a new Chrome configuration, clickAdd. A new item appears in the list. In the Path field, specify the path to the Chrome installation folder.

  4. Select the new configuration and clickEdit. The Chrome Settings dialog opens.

  5. Select the Use custom user data directory checkbox and specify the path to your user data directory in the IntelliJ IDEA settings.

  6. Mark your Chrome browser configuration default as described in Choosing the default IntelliJ IDEA browser, and don't forget to choose Default from the Browser list when creating a run/debug configuration.

To debug with the JetBrains Chrome extension

Last modified: 14 December 2018

See Also