-
-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-error-overlay line numbers are wrong since 2.1.5 release #6433
Comments
What do the line numbers appear to correspond to? |
They seem to be offset by an arbitrary number (20 lines in my repro case). I'm guessing something is off in the way react-error-overlay is parsing the new sourcemap format. |
Confirming same bug within my codebase. |
I bet a reproducing case would help. |
Is anyone not able to repro? AFAICT, triggering the overlay (throw an exception) in any CRA app should do it. If that's not the case, I can dig deeper. |
I had tested this on a few apps prior to release and the line numbers appeared correct for me. |
I have a repo case in my app, I can try debug this a bit. It is actually pretty confusing to a user because the line displayed in the error overlay had no issues and the error was 12 lines above. |
The difference between chrome source and the react-overlay-source are the following extra lines in chrome:
|
This all sounds vaguely familiar -- I think it's a bug in webpack. We had to get it fixed for |
I've got #6444 up if that's what we want to do in the short term. |
Note that switching back will reintroduce #6074. So it's basically a choice between breakpoints being broken and the error overlay being broken. 😦 This one probably affects more people more of the time. But when it breaks, it's pretty easy to figure out and look at the console for the real stack trace. With the breakpoints issue, it's really hard to figure out why they aren't working, and once you do, the solution is more tedious (you have to manually kill and re-run In conclusion: ¯\(ツ)/¯ |
To reproduce: throw an error in your react app that results in the error overlay appearing. The line number it shows will be wrong (and thus, also the lines of code that it displays).
This was broken by the switch to eval-source-map in the 2.1.5 release. I confirmed that switching back to
cheap-module-source-map
fixes the issue.cc @Timer @jasonLaster @ianschmitz
Environment
Environment Info:
System:
OS: macOS 10.14.3
CPU: x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Binaries:
Node: 11.6.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
Browsers:
Chrome: 72.0.3626.109
Firefox: 65.0
Safari: 12.0.3
npmPackages:
react: ^16.8.1 => 16.8.1
react-dom: ^16.8.1 => 16.8.1
react-scripts: ^2.1.4 => 2.1.5
npmGlobalPackages:
create-react-app: Not Found
The text was updated successfully, but these errors were encountered: