CLion 2016.3 Help

Configuring JavaScript Debugger

On this page:

Introduction

Debugging JavaScript in CLion is supported through the JavaScript Debugger. The plugin is bundled with CLion and activated by default. If the plugin is not activated, enable it on the Plugins page of the Settings / Preferences Dialog as described in Enabling and Disabling Plugins.

Debugging of JavaScript code is supported in Google Chrome and other browsers of the Chrome by means of browser-specific JetBrains extensions. No special steps are required from your side to install or enable these extensions. CLion does it for when you initiate a debugging session for the first time.

During a debugging session, CLion considers any injected JavaScript code in a Web page opened in the browser as subject for debugging. This means that you cannot use the same instance of a browser for browsing and for debugging simultaneously. For Google Chrome you can solve this problem by configuring CLion to use a separate Chrome user profile for debugging.

Common JavaScript debugger options

To configure the settings for debugging JavaScript code

  1. Open the Debugger page: choose File | Settings and in the Settings dialog box that opens, click Debugger under Build, Execution, Deployment.
  2. On the Debugger page that opens, specify the following:
    • Use the Built-in server port spin-box to specify the number of the port where the built-in web server runs. The port number should be set to 1024 or higher. By default this port is set to the default CLion port through which CLion accepts connections from services (63342). During a debugging session, the Chrome extension will listen to this port. If for some reason the default CLion port is already busy, CLion finds the closest available port and starts on it. This results in a conflict: CLion is running on a "new" port while the Chrome extension still listens to the port of a previously started product and fails to establish connection with CLion. The conflict reveals when you initiate a debugging session from CLion: the extension fails to connect through the default port, CLion waits for connection from the extension and displays the following message with the port number where it is actually running:
      js_debug_install_extension.png

      To fix the problem, specify the actual port in the Chrome extension options, see Using JetBrains Chrome Extension.

    • In the Value tooltip delay (ms) field of the Data Views page , specify the time period between pointing at an object and displaying the object's value in a tooltip.
    • On the JavaScript page, specify the following:
      • Whether to display DOM properties in a tab or not.
      • Whether you want object node properties to be shown. If so, specify the properties. Use /help/img/idea/new.png and /help/img/idea/delete.png to manage the list of properties.

See Also

Last modified: 22 November 2016