-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Source Maps don't work on Chrome #2145
Comments
Having this same issue. Could also be related to Babel 6. |
+1 |
I'm having this issue too. The interesting thing is that it only happens in Windows. In OS X and Linux the source maps line up correctly. Maybe there is some kind of LF/CRLF issue? I verified that my source maps generated in windows, linux, and OS X line up correctly using this tool: http://sokra.github.io/source-map-visualization/ |
+1 |
@iknowcss I am also using my project in Windows, maybe this shows something. |
I have this issue on OSX. |
Yes I have the issue on OSX too. |
+1 |
+1 have this issue on OSX |
I'm also having major problems with |
+1 OSX |
+1 on Windows Chrome 49.0.2623.8. using devtool: source-map works for the time being, although much slower for dev. |
Seeing this now also. OSX, Chrome 49.0.2623.110. Swapping to inline-source-map, again at the cost of dev time. Out of interest, I've seen stack traces on other projects include line numbers from source maps (rather than app.bundle.js:100000:15). Is this something on the source-map side, or a browser add-in? |
I'm seeing this as well on OS X 14.5.0 using Chrome 50.0.2661.75 (64-bit) |
Haven't tested all of these options, but running into some of the same issues right now on Windows. 'inline-source-map' allows breakpoints to be hit in Chrome, but 'eval-source-map' doesn't... the breakpoints are never hit. Will do further testing with other options as I get time. |
I'm on OSX, chrome (dev channel) refuses to load my maps. (console message) I've created a gist Here is a repo showing it: |
In my broken-source-maps repo, I believe that I've isolated webpack as the sourcemap problem... |
same here on Windows. |
My guess: as a result of code modification and HMR, the JS running in browser changed, but in meanwhile, chrome doesn't update the sourcemap, so real code and sourcemap are not in-sync anymore, which results in breakpoints' malfunction. Possible? |
+1 OSX |
It's the size! Once the source maps get too large chrome is choking. I setup my project to split the node_modules from my own code and the vender chunk still dies, but my chunk's map works! :) |
Seeing this happen on two Windows machines, but not on OS X (weird). |
+1 OS X |
There certainly seems to be a problem with Chrome 51. See Chrome Bug 611328. |
"#inline-source-map" or "#source-map" made the breakpoint work on OSX Chrome, build/rebuild speed is slower though. |
It's fixed (and confirmed working for me) in Canary now https://bugs.chromium.org/p/chromium/issues/detail?id=611328#c21 |
+1 osx |
- updated to react 16. - created a component mounting helper to initalize react componenets from rails views - create a component registery, so that plugins can register their top level containers - broke down generate webpack chunks into plugin specific vs common js code (to avoid duplications of js code within the bundle) - change webpack source maps to inline so it can easily be used to debug in the browser. (see webpack/webpack#2145)
Just throwing some tips for people on Chrome with issues. If you have the original files, you don't want to use to include the source code in your source map. Use It would be nice if you could remap |
@sokra thinks you don't need to edit your original files in browser:
Anyway ;-) I don't think that webpack 4 is going to solve any actual problems you need to solve:
So, this issue is most important one. Why webpack adds 4 newlines and a footer comments to each module even when no loaders are enabled? It's ES8 era, and we no more need Babel. Luckily, @sokra's comment has an advice on how to solve the problem with "real" file paths to make debugging and editing a smooth experience, as it should be. By the way, if you use transpilation, from TypeScript, CoffeeScript, etc., keep in mind that your transpiler CAN supply perfectly consumable source map to webpack, so it HAS TO refer to your original TypeScript file instead of the intermediate transpiled one. Which allows to put breakpoints right into your original source code - in devtools - and even edit it right there. Many stages of very correct source map transformations must happen in order to preserve that smooth developer experience. Unfortunately, webpack doesn't embrace convention over configuration, and breaks your config file every major release, so all this source map transformation pipeline seems to be broken almost all the time. For sure, it was working for me 2 years ago allowing to smoothly debug my Babel-transpiled ES2015 sources in Chrome, but now it's the era of disabling all of the transpilation, and things are broken again. I'm very, super sad and incredibly frustrated that the awesome and pretty fast tool which practically all web developers have to use every day (we just have no other production-ready choice able to solve a lot of problems), is appears to be broken almost all the time. The amount of time I've spent since the first I think, the webpack team should reconsider their over-engineering priorities with the new CSS modules approach, and focus on webpack@5 to get rid of all configurable plugins to support debuggable and editable minified outputs and CSS imports with extracted text OOB. IMO. Don't be hard on me. The npm team already had issues with my sarcastic impatience, but I have no idea how to express your opinion otherwise. Note that I'm not offering to "fire" @sokra LOL Happy 2018! |
- updated to react 16. - created a component mounting helper to initalize react componenets from rails views - create a component registery, so that plugins can register their top level containers - broke down generate webpack chunks into plugin specific vs common js code (to avoid duplications of js code within the bundle) - change webpack source maps to inline so it can easily be used to debug in the browser. (see webpack/webpack#2145)
- updated to react 16. - created a component mounting helper to initalize react componenets from rails views - create a component registery, so that plugins can register their top level containers - broke down generate webpack chunks into plugin specific vs common js code (to avoid duplications of js code within the bundle) - change webpack source maps to inline so it can easily be used to debug in the browser. (see webpack/webpack#2145)
- updated to react 16.2. - created a component mounting helper to initalize react componenets from rails views - create a component registery, so that plugins can register their top level containers - broke down generate webpack chunks into plugin specific vs common js code (to avoid duplications of js code within the bundle) - change webpack source maps to inline so it can easily be used to debug in the browser. (see webpack/webpack#2145)
webpack/webpack#2145 That's the only one that actually works, both for breakpoints and test traces.
- updated to react 16.2. - created a component mounting helper to initalize react componenets from rails views - create a component registery, so that plugins can register their top level containers - broke down generate webpack chunks into plugin specific vs common js code (to avoid duplications of js code within the bundle) - change webpack source maps to inline so it can easily be used to debug in the browser. (see webpack/webpack#2145)
This is very much still an issue. |
This There's a lot of talk, but this was the best I could get out of them:
There's 130 people subscribed to this thread, I think this issue could use a bit more visibility. I really don't like to see Chrome enforcing certain user/dev workflows like this. |
There is a workaround in the second post on this thread: |
Configuring with this |
inline source maps works |
this solution worked for me. Thanks @wallynm |
This comment has been minimized.
This comment has been minimized.
* upstream-master: chore(package): update react-dom to version 15.4.1 Workaround for chrome bug: webpack/webpack#2145 chore(package): update react to version 15.4.1 chore(package): update css-loader to version 0.26.0
Hello everyone,
I just started to use webpack and I'm having serious issues in debugging my code.
The problem is that the Chrome debugger doesn't work properly.
I'm not sure if this is a webpack issue, a Chrome issue or my fault.
This is my webpack file
By changing the
devtool
option I get different behaviours:I've tried to search both Chrome and Webpack related issues, changing browser or anything else it comes in my mind without success.
The text was updated successfully, but these errors were encountered: