-
Notifications
You must be signed in to change notification settings - Fork 74
Source maps broken since "redbox-react" #40
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hmmm that's weird. I wonder if changing devTool source maps to It looks like redbox has a few issues on their repo, delicate-error-reporter might be a bit more stable? |
Wow, quick response :) "source-maps" and "eval" in "devtool" setting didn't change anything but maybe there was still some cached sourcemap active or something like that. delicate-error-reporter looks nice but the stack trace and inspector log does look the same as with redbox Thanks for looking into this |
No prob 😄 I thought I remember that some of the babel transforms work by wrapping classes... i'm wondering if all the error reporters do this? I guess they would have to wrap everything with a try/catch or something to snatch up the errors. At any rate I think if you remove the 2nd item in the react-transform array that should take it back to normal.
|
Ok now i'm more confused.... I fired up my fork of webpack (commit ecc7518) and it's working for me. Perhaps it's some kind of caching issue? I know i've seen what you've mentioned though. Here's what I have with a debugger and showing a 'paused on caught exception' showing vim line number and sourcemap: This may shed some light? perhaps adding the webpack-contrib/transform-loader#9 |
Yeah, this caught me off guard too. |
Okay, I was able to reproduce in the latest version of this poject, with |
Without |
Yea this is breaking for me too... I thought it was a problem with the debugger lines... I need some sleep 😆 |
Oh wait, are you all folks using Then you'll need to put |
Or wait, I'm missing the point again. The issue is about filenames, not about |
Ah, cool, thanks @gaearon! I'll close my issue once I've verified that fixes it. Yes, we're still in the dark ages here :) I haven't investigated a way to use the |
@gaearon I've spent the past hour or two investigating the source map issue, and I'm still not sure what it is. I can't repro by altering |
Let me take a look too. |
What do you folks run? |
@gaearon wow, thanks. In this project just |
I put up a simplified project here: https://github.com/jedwards1211/react-transform-source-map-test In that project stack traces inside component |
Actually hang on, let me remove some unnecessary deps from that |
What is the expected behavior? I don't fully understand the issue so showing expected / actual behavior would help. |
From your initial post screenshot, it doesn't seem that sourcemaps are broken. It just says |
Ah, sorry. In
Expected stack trace as correctly prints when I throw an error from App in
|
I can't tell if source maps are broken or something else about my webpack configuration is wrong. |
OK, I think I understand the problem now. You used to have nice filenames the console, but now you see |
Right. In any case now that I've seen everything works with |
Maybe it was 4b0bd6b that introduced the change? |
I've tried with various devtool options, in |
quite the complex mash of tools here, and I don't know enough to have a good idea what's causing this |
Specifically |
Sure, no worries. I know it's a crazy mix. Looking into your test case—thanks for assembling it. |
Oh, man, I'm so sorry, I forgot to check that. It actually doesn't fix the problem. I thought for sure it had to do with |
Not a problem for me, let's keep looking. Please post your exact |
You can try copying |
And |
Copied the entire |
Do you have this problem when using https://github.com/gaearon/react-hot-boilerplate? |
@gaearon I finally figured it out by transforming
So in other words when I changed to Thanks for your help again, and I hope you didn't have to sacrifice too much time on this. And thanks for all you've done for the React community! |
No problem. Every riddle feels impossible to solve until it's solved and feels obvious in retrospect. |
@gaearon aha, try this in
With these settings redbox displays the bad (i.e. linking to the bundle) stack trace, even though the one printed by |
@gaearon Yup, although it won't be obvious to me until if/when I know how the various |
@jedwards1211 |
Yeah, I'll go read their source |
So they parse |
Definitely possible. However it isn't hard for us to provide filename info to the error reporter. Would you like to make a PR to |
Sure, let me take a look |
Or would you prefer passing all properties except |
I think just |
i.e.
|
okay, sounds good |
Doing this in plugin is better because we know filename there—we don't have to guess, and |
Right, I'm just thinking about the fact that it won't work for the entire stack trace, just the deepest module. In any case it would be nontrivial to use that package right now, and it only supports chrome at the moment |
@JBBr @AdamBrodzinski I just changed the |
@jedwards1211 Ah thanks for the heads up! What a crazy bug! I'm using eval currently anyway since it seems to be the fastest reloads. Thanks!! |
Thanks for debugging this issue.
|
@JBBr I understand -- for the default in this skeleton I just want to use the config that's least likely to make people open new issues. |
Since commit ecc7518 source maps seems to be broken
The nice big red error stacktrace is shown but every class name gets "ProxyClass", line numbers are wrong and the Chrome inspector does only show the bundled file names.
With the previous commit 9e6a666 the big red error stacktrace is gone but Chrome shows correct filenames and line numbers (I intentionally broke App.jsx on line 27)
The text was updated successfully, but these errors were encountered: