EagleCanFly
EagleCanFly

Reputation: 99

How to debug with breakpoints in React?

I'm using Chrome. For example I need Component.jsx and put a breakpoint somewhere. I press F12, select Sources tab, press Ctrl+P but all I get is 1.chunk.js, bundle.js and main.chunk.js. It's pretty inconvinient to search for the position in the files. Can someone help me to find a solution?

Upvotes: 6

Views: 18725

Answers (1)

GorvGoyl
GorvGoyl

Reputation: 49600

Have you setup your debugger right?
Assuming you use VSCode, you need to install chrome debugger extension and add vscode debugging configuration to make it work.
VSCode team has put up a nice tutorial here: https://code.visualstudio.com/docs/nodejs/reactjs-tutorial#_debugging-react

Upvotes: 2

Related Questions