CLion 2017.1 Help

Run/Debug Configuration: JavaScript Debug

In this dialog box, create a configuration to be used for debugging JavaScript in applications running on the built-in or on an external web server and for debugging Dart Web applications.

CLion supports debugging applications running on the built-in or an external web server only in Google Chrome and other browsers of the Chrome family. Debugging applications running on the built-in server is supported for Firefox, version 36 an higher, through the Firefox Remote debug configuration. Debugging applications running on external web servers in Firefox is not supported at all.

On this page:

JavaScript Debug-specific configuration settings

ItemDescription
NameIn this text box, specify the name of the current run/debug configuration.
Share Select this check box to make the run/debug configuration available to other team members.

The shared run/debug configurations are kept in separate xml files under .idea\runConfigurations folder, while the local run/debug configurations are kept in the .idea\workspace.xml.

This check box is not available when editing the run/debug configuration defaults.

URL
  • Debugging JavaScript:

    In this text box, specify the URL address of the HTML file that references the JavaScript to debug. For local debugging, type the URL in the format http://localhost:<built-in server port>/<project root>. The built-in server port (1024 or higher) is specified on the page of the Settings dialog box.

  • Debugging a Dart Web application:

    In this text box, specify the URL address of the HTML file the references the Dart code to debug. Make sure that the port specified in this URL address is the same as the Built-in server port on the Debugger page of the Settings dialog box and the port specified in the settings for the Chrome Extension.

Browser From this drop down list, select the browser, where your application will be debugged.
  • Debugging JavaScript:

    Chrome

  • Debugging a Dart Web application:

    If you choose Dartium which has a built-in Dart virtual machine, simply the Dart code is executed. If you choose Chrome, the Dart code is compiled into JavaScript through the Dart2js tool, which is a part of the Pub tool. Whether such compilation is required or not is decided by the Pub Serve tool. The tool is invoked automatically when you run or debug a Dart web application, either by opening an HTML file or by launching a run/debug configuration. The tool analyzes the <script></script> element in the HTML file. If the element references a Dart file, Pub Serve invokes the Dart2js compiler whereupon the compiled JavaScript files are passed to the browser where they are processed.

    Specify the URL address of the HTML file the references the Dart code to debug. Make sure that the port specified in this URL address is the same as the Built-in server port on the Debugger page of the Settings dialog box and the port specified in the settings for the Chrome Extension.

Remote URLs of local files
  • Debugging JavaScript:

    CLion displays this area only when you create a permanent debug configuration manually. For automatically generated temporary configurations the area is not shown.

    In this area, map the local files to be involved in debugging to the URL addresses of their copies on the server.

    • File/Directory - in this read-only field, select the desired local file or directory in the project tree.
    • Remote URL - in this text box, type the absolute URL address of the corresponding file or folder on the server.

    These mappings are required only if the local folder structure under the project root differs from the folder structure on the server. If the structures are identical, CLion itself "retrieves" the paths to local files by parsing the URL addresses of their copies on the server.

  • Debugging a Dart Web application:

    CLion displays this area only when the port specified in the URL field is different from the port of the built-in Web server specified on the Debugger page of the Settings dialog box.

See Also

Last modified: 19 July 2017