JetBrains Rider 2025.1 Help

Run and debug Angular applications

Run an Angular application

  1. Сlick the Run icon in the gutter next to the start script in package.json, or execute the npm run start command in the Terminal Alt+F12, or double-click the start task in the npm tool window (View | Tool Windows | npm).

    Run an Angular app in the development mode from package.json
  2. Wait till the application is compiled and the development server is ready.

    The Run tool window or the Terminal shows the URL at which your application is running. If your application was generated with @angular/cli, the default URL is http://localhost:4200/. Click this link to view the application.

    Running Angular CLI app: the Development server is ready

Run an Angular application via a run/debug configuration

For applications created with Angular CLI , JetBrains Rider generates an npm configuration . This configuration runs the ng serve command that launches the development server and starts your application in the development mode.

In other cases, you need to create a run/debug configuration with the actual settings, such as, host, port, etc., manually.

Create an npm run/debug configuration

  1. Go to Run | Edit Configurations. Alternatively, select Edit Configurations from the Run widget on the toolbar.

    Open the Edit Configurations dialog

    In the Edit Configurations dialog that opens, click the Add button (the Add button) on the toolbar and select npm from the list.

  2. In the Configuration tab of the Run/Debug Configurations: npm dialog that opens, specify the location of the package.json, the Node.js interpreter, and the package manager to use.

    In the Command field, select run from the list and then select the script to run from the Scripts list. Most likely it will be the default start script but you can configure another one in your package.json, for example, to run the application on a custom port.

    npm run/debug configuration
  3. Optionally:

    To open the application in the browser, update the configuration as follows: in the Browser / Live Edit tab, select the After launch checkbox, select the browser to open the application in, and specify the URL address at which the application wil run.

    If you are going to debug the application, select Google Chrome or another Chromium-based browser.

    Browser / Live Edit tab: select browser

Run an application

  1. From the list in the Run widget on the toolbar, select a run configuration of the type npm. This can be the autogenerated Angular CLI Server configuration or a custom one that you created yourself as described above.

  2. Click Run.

    Run a Vue.js app in the development mode via a run/debug configuration
  3. Wait till the application is compiled and the development server is ready.

    The Run tool window or the Terminal shows the URL at which your application is running. If your application was generated with @angular/cli, the default URL is http://localhost:4200/. Click this link to view the application.

    Running Angular CLI app: the Development server is ready

    Alternatively, enable JetBrains Rider to open the application on start as described above.

Debug an Angular application

You can start a debugging session either by launching a run/debug configuration or from the Run tool window that shows the URL at which your application is running in the development mode.

Start debugging via a run/debug configuration

To debug your Angular application, you need two run/debug configurations:

  • An npm configuration to start your application in the development mode, as described above.

  • A JavaScript Debug configuration to attach the debugger to the application that is running in the development mode.

You can create a JavaScript Debug configuration within the npm configuration to launch them at once, as described in Run and debug an Angular application with an npm run/debug configuration.

Alternatively, launch an npm and a JavaScript Debug run/debug configurations separately, as described in Start debugging with a JavaScript Debug run/debug configuration.

Run and debug an Angular application with a single npm run/debug configuration

  1. Set the breakpoints in your code.

  2. Create an npm configuration as described above.

  3. In the Configuration tab of the Run/Debug Configurations: npm dialog that opens, specify the location of the package.json, the Node.js interpreter, and the package manager to use.

    In the Command field, select run from the list and then select the script to run from the Scripts list. Most likely it will be the default start script but you can configure another one in your package.json, for example, to run the application on a custom port.

    npm run/debug configuration
  4. In the Browser / Live Edit tab, select the After launch checkbox, select Google Chrome or another Chromium-based browser from the list, select the with JavaScript debugger checkbox, and then specify the URL at which your application will run.

    npm configuration, Browser tab
  5. Click Run.

    To re-run the configuration, select it from the list in the Run widget and click Run next to it.

    JetBrains Rider runs the application in the development mode and at the same time launches a debugging session.

    Debugging session
  6. When the first breakpoint is hit, switch to the Debug window and proceed as usual: step through the program, stop and resume program execution, examine it when suspended, explore the call stack and variables, set watches, evaluate variables, view actual HTML DOM, and so on.

Start debugging with a JavaScript Debug run/debug configuration

  1. Set the breakpoints in your code.

  2. Start the application in the development mode as described above and wait till the application is compiled and the development server is ready.

    The Run tool window or the Terminal shows the URL at which your application is running. Copy this URL to specify it later in the JavaScript Debug configuration.

    Angular app is running in the development mode
  3. Create a JavaScript Debug configuration. To do that, go to Run | Edit Configurations in the main menu, click the Add icon, and select JavaScript Debug from the list.

    If you generated your application with Angular CLI, JetBrains Rider has already created a JavaScript Debug run/debug configuration with the default name Debug Application and the default URL http://localhost:4200. Select this run/debug configuration from the list under the JavaScript Debug node.

    Select the generated JavaScript debug run/debug configuration
  4. In the Run/Debug Configurations: JavaScript Debug dialog that opens, specify the name of the configuration and the URL address at which the application is running in the development mode. You can copy this URL in the Run tool window or in the Terminal, as described above.

    Create a JavaScript Debug configuration: specify the URL
  5. Click Debug.

    To re-run the configuration, select it from the list in the Run widget and click Debug next to it.

    Run a JavaScript Debug configuration from the Run widget
  6. When the first breakpoint is hit, switch to the Debug window and proceed as usual: step through the program, stop and resume program execution, examine it when suspended, explore the call stack and variables, set watches, evaluate variables, view actual HTML DOM, and so on.

Start debugging from the Run tool window or from the built-in Terminal

If your application is running in the development mode on localhost, in particular, if it was generated with Angular CLI, you can launch a debugging session right from the >Run tool window or from the built-in Terminal.

  1. Set the breakpoints in your code.

  2. Start the application in the development mode as described above and wait till the application is compiled and the development server is ready.

  3. The Run tool window or the Terminal shows the URL at which your application is running. If your application was generated with @angular/cli, the default URL is http://localhost:4200/. Hold Ctrl+Shift and click this URL link. JetBrains Rider starts a debugging session with an automatically generated Angular Application configuration of the type JavaScript Debug.

    Starting a debugging session from the Run tool window

    Alternatively, select the autogenerated Angular Application configuration from the list and click the Debug button the Debug button next to the list.

    If you launched your application in the development mode from the New Terminal, you can just click the Start debugging in browser button next to the link.

    New Terminal: the Start debugging Angular in browser button

When the first breakpoint is hit, switch to the Debug tool window and proceed as usual: step through the program, stop and resume program execution, examine it when suspended, explore the call stack and variables, set watches, evaluate variables, view actual HTML DOM, and so on.

Troubleshooting for Node.js 17+

If you are using Node.js version 17 or later, during a debugging session you may face network connectivity issues that result in problems with attaching the debugger or with loading sourcemaps.

The workaround is to pass --host 127.0.0.1 to the server by updating the start script in your package.json as follows:

"start": "ng serve --host=127.0.0.1"
Last modified: 10 April 2025