Mr. Foots
Mr. Foots

Reputation: 340

Inaccurate line reporting of React JS error

I have been having numerous issues with error reporting in React js. So the actual error will be correct, but the line reported will not be. I'm guessing this is because the JSX is converted into regular Javascript, thus either creating more or less lines of code. This makes it rather difficult to actually track down and fix these errors, when the console is telling me it occurs on line x and line x is a newline or other random code that is obviously not connected to the error. Has anyone else solved this issue?

I am using Google Chrome and I also have the react developer tools installed.

Upvotes: 3

Views: 1731

Answers (1)

Michael Camden
Michael Camden

Reputation: 1218

Per our conversation via comments, a solution is to use Source Maps.

Upvotes: 1

Related Questions