-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Use better-suited devtool option for sourcemaps #3494
Comments
As far as I remember our option is the only one that reliably worked in Chrome with breakpoints. Others either ignore breakpoints on start, or put them in wrong places. (Maybe this got fixed by now.)
Can you explain how this is possible? |
Not sure about breakpoints, but I have always been using |
Right now, breakpoints seem to be working fine for me in chrome with Source maps support mapping of variable/symbol names. I assume only the more comprehensive sourcemap generation options do this, whereas the more lightweight options do not. See https://bugs.chromium.org/p/chromium/issues/detail?id=327092 In any case, the current choice is not recommended so it's probably worth changing to one that is recommended, even if it is not |
I just want to make it clear that we didn't pick the current one randomly. We picked it after weeks of complaints and research as to which option works most reliably, and reporting bugs upstream. Maybe it's not "recommended" but there were good reasons why it was chosen. At the time the "recommended" ones were problematic, and I don't know if the webpack documentation authors were aware of these problems or not (and whether they are now). So it's worth doing a very extensive check with the test cases one can find in different past issues, both here and in webpack repo. |
(There is also an issue of compilation speed in larger projects. Especially hot reloading. The chosen option can make a difference between 200ms and 2 seconds.) |
I did ask initially if there is some reason for choosing it that's not obvious. So thanks for the insight on that :) And I absolutely agree that it's a change that shouldn't be made on a whim, or without extensive research. Regarding compilation speed, webpack docs say that |
No idea, sorry 😄 If you feel like doing this research again, you are most welcome! |
We recently landed support for mapping scopes and variables in Firefox DevTools. The feature requires column-based mappings, which are needed for accurately mapping identifiers between original and generated code. Webpack has a couple of source map options that work well (source-map, eval-source-map , inline-source-map). Basically it can't be cheap (read line-based) and it has to include the original source docs. Would you be open to switching from a cheap-module-source-map to one of the other options in development? BeforeAfter |
Awesome! Thanks @jasonLaster |
I recently hit an issue where
this
value was showing up asundefined
when debugging in browser's dev tools, in cases like this:Note, this is only when debugging and inspecting the value (e.g. mouseover), the actual code is fine when running.
After some research I realised this was due to the choice to sourcemap generated by webpack. You currently have it set to
"cheap-module-source-map"
, which the webpack docs say is "not ideal for development nor production".The webpack docs recommend either
"eval"
,"eval-source-map"
,"cheap-eval-source-map"
, or"cheap-module-eval-source-map"
for dev."eval-source-map"
fixed the issue I described above.Is it worth changing to a setting recommended by webpack, or is there some specific reason for using
"cheap-module-source-map"
that is not obvious to me?The text was updated successfully, but these errors were encountered: