-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Sourcemaps do not debug correctly in chrome. (T7210) #4177
Comments
This repository reproduces the issue, without involving webpack, and also demonstrates the breakpoint working when transpiling with babel 6.4.4. |
If you're subscribing to this and you're unable to place a breakpoint in other places that aren't arrays like in this example, it'd be great to get more reproduction cases for this. |
I was playing around with the sample, and found that if I run this
I can't set a breakpoint in the |
opening a babel-generated sourcemap in Visual Studio and setting a breakpoint shows there is an 4-character offset (see the attached image). The offset could explain why some lines are breakpointable and some others not. I hope this is an hint. {F80363} |
Closing this issue as it's been inactive for several months. Please feel free to open a new issue or leave a comment asking to reopen this issue. Thanks! ✌️
|
Is there any way we can re-open this? Running across an issue where breakpoints in chrome are off by one line. |
I should mention that I think there is merit with having sourcemaps compiled using eval. There is a work around with webpack using eval. If there is a way we can figure out how to do that with babel-cli, that would solve issue for most: https://stackoverflow.com/questions/46669432/using-the-webpack-eval-devtool-option-with-babel-cli Users can then migrate from babel over to webpack. Giving more space for this issue to be solved. Thank you. |
@CharlieGreenman If something works with eval but not normal sourcemaps, then that's just a Webpack bug, because either way Babel is generating the exact same sourcemap. |
@loganfsmyth just to clarify. This is an issue using the babel cli |
@CharlieGreenman This issue is about Babel in general failing to create accurate sourcemaps in some cases. Whether a sourcemap is inlined with |
@loganfsmyth you are right. That being said, I have the following question. Would we be able to offer an eval option for the babel cli? |
Bug information
Options
Input code
Description
edit: Please check tebari's comment for a demo repo that reproduces the issue.
This is a simplified example that demonstrates messed up break points while using Chrome v48.0.2564.116. If you transpile this code using babel-cli:
Then in Chrome it won't let you set a break point on line 3. However line 17 is fine.
If you use the raw js file without transpiling, Chrome can add a break point on line 3. Also I found that Babel 6.4.4 generates sourcemaps that work correctly in Chrome.
{F49466}
The text was updated successfully, but these errors were encountered: