JetBrains Rider 2018.1 Help

Running TypeScript

Before running or debugging, you need to compile your TypeScript code into JavaScript. You can do that on the fly, using JetBrains Rider integration with the TypeScript Language Service, or via another tool, learn more from the TyprScript Official website.

Running TypeScript

No run configuration is required for launching applications with injected TypeScript from JetBrains Rider.

  1. Compile the TypeScript code into Javascript.
  2. In the editor, open the HTML file with the TypeScript reference. This HTML file does not necessarily have to be the one that implements the starting page of the application.
  3. Do one of the following:
    • Choose View | Open in Browser on the main menu or press Alt+F2. Then select the desired browser from the pop-up menu.
    • Hover your mouse pointer over the code to show the browser icons bar: browserIcons Click the icon that indicates the desired browser.

Debugging TypeScript

Before you start, configure the built-in debugger as described in Configuring JavaScript Debugger. To use the Live Edit functionality and view the changes in your HTML and CSS in the browser on the fly, install the JetBrains IDE Support Chrome extension. Find more in Live Edit in HTML, CSS, and JavaScript.

To recognize breakpoints you set in the TypeScript code, JetBrains Rider needs source maps To generate them during compilation, open the tsconfig.json file and make sure the sourceMap property is set to true.

Debugging client-side TypeScript

Most often, you may want to debug a client-side application running on an external development web server, e.g. powered by Node.js.

  1. Configure and set breakpoints in the TypeScript code.
  2. Compile the TypeScript code into JavaScript.
  3. Run the application in the development mode. Often you need to run npm start for that. When the development server is ready, copy the URL address at which the application is running in the browser - you will need to specify this URL address in the run/debug configuration.
  4. Create a debug configuration of the type JavaScript Debug:
    Choose Run | Edit Configuration from the main menu, click add on the toolbar and select JavaScript Debug from the pop-up list.
  5. In the Run/Debug Configuration: JavaScript Debug dialog that opens, specify the URL address at which the application is running. This URL can be copied from the address bar of your browser as described in Step 3 above. Click OK to save the configuration settings.
  6. Choose the newly created configuration in the Select run/debug configuration drop-down list on the toolbar and click Debug debug. The URL address specified in the run configuration opens in the chosen browser and the Debug window appears.
  7. In the Debug tool window, proceed as usual: step through the program, stop and resume the program execution, examine it when suspended, view actual HTML DOM, etc.
Last modified: 19 April 2018

See Also

Procedures:

Reference: