Debugger does not stop at any break-points in React
No matter what I try, I cannot stop the debugger at any break-points in a react app.
Here are the steps to reproduce.
- Running on debian 12.
- Create a new react project with
npm create vite@latest- Select
React - Select
TypeScript + React Compiler - Select
Use rolldown-vite (Experimental): No - Select
Install with npm and start now?: Yes - End process with
CTRL+Cand Close the terminal
- Open the project folder in WebStorm
- Realize that WebStorm did not create a configuration by default. Manually create a configuration:
- Click
Edit Configurationat top right drop down menu. - Click
+and selectnpm - Click
Commandand selectrun - Click
Scriptsand selectdev - Click
OK
- Click
- In the editor, add multiple break-points to the code.
- Hit
Debug ‘dev’ Shift+F9button at top right. - The page did not open by default, open the page in firefox.
- No break-points are hit.
- Insert
surprised_pikachu.jpg
Any ideas what I am doing wrong?
Please sign in to leave a comment.
Did you try the steps in https://www.jetbrains.com/help/webstorm/react.html#react_running_and_debugging_debug? Start the application by running
npm dev(can be done either in terminal or with NPM run configuration, using the gutter icons), and, once the application is up and running, create the JavaScript Debug run configuration withhttp://localhost:5173/set as URL and press Debug. A hint: you canCtrl+Shift+clickon the URL displayed in the NPM run console to auto-create the configuration and start the debugger:See https://www.jetbrains.com/help/webstorm/react.html#react_debug_from_tw for more info.
If this doesn't work for you, could you please share a screencast of the problem with us? This will help us to understand what it looks like on your side.
I tried the steps as instructed, but I still can’t debug the React app. The server runs fine at http://localhost:5173/, but when I create the JavaScript Debug configuration, the breakpoints don’t work. I also tried Ctrl+Shift+click from the console, but it still doesn’t work.
https://www.jetbrains.com/help/webstorm/react.html#react_running_fun games_and_debugging_debug
I will send a screencast for further investigation.
Unfortunately I failed to reproduce the issue.
A video recording of your steps would be helpful.