IntelliJ IDEA 2026.1 Help

Run and debug React applications

Run a React 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 a React 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 create-react-app, the default URL is http://localhost:3000/. Click this link to view the application.

    React app is running

Run a React application via a run/debug configuration

For applications created with create-vite in the IntelliJ IDEA New Project wizard as described above, IntelliJ IDEA generates an npm configuration with the default name npm start. This configuration runs the react-scripts start 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 runtime, 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. Select the npm start run configuration from the list on the toolbar and click Run next to it.

    Run a React app in the development mode via a run/debug configuration
  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. Click this link to view the application.

    React app is running

    Alternatively, enable IntelliJ IDEA to open the application on start as described above.

Debug a React 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 React 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 a React application with an npm run/debug configuration.

Alternatively, create and 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 a React application with a single npm run/debug configuration

Run and debug a React application with a single npm run/debug configuration

  1. Set the breakpoints in your code.

  2. Create an npm configuration as described above.

    If you generated your application with create-react-app, IntelliJ IDEA has already created an npm configuration with the default name npm start. The configuration is available from the Run widget and in the Run/Debug Configurations dialog.

    Autogenerated npm run/debug configuration
  3. In the Configuration tab of the Run/Debug Configurations: npm dialog that opens, specify the location of the package.json, the Node.js runtime, 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.

    IntelliJ IDEA 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 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.

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.

    Application 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.

  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 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.

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 create-react-app, 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. Hold Ctrl+Shift and click this URL link. IntelliJ IDEA starts a debugging session with an automatically generated configuration of the type JavaScript Debug.

    Start debugging a React app from the Run tool window

    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 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.

Known limitations

When you open an application during a debugging session for the first time, it may happen that some of the breakpoints in the code executed on page load are not hit. The reason is that to stop on a breakpoint in the original source code, IntelliJ IDEA needs to get the source maps from the browser. However, the browser can pass these source maps only after the page has been fully loaded at least once. As a workaround, reload the page in the browser yourself.

10 February 2026