I'm having an issue where the sourcemaps generated by Webpack using the inline-source-map
configuration setting are off by one line when I use the Chrome devtools debugger.
Webpack is set up inside a Ruby on Rails application to generate a concatenated, unminified JavaScript file composed of a couple dozen modules. Most of those modules are ReactJS components, and are parsed by the jsx
loader. The output from Webpack is then included in the application.js
file along with some other JavaScript libraries generated by gems.
When I use eval-source-map
, there is no problem. Something about the use of inline-source-map
causes the line numbers to be thrown off by one.
Inspecting JavaScript that is not a React component still has this issue, so I don't think it's related to the use of jsx.
I'm having an issue where the sourcemaps generated by Webpack using the inline-source-map
configuration setting are off by one line when I use the Chrome devtools debugger.
Webpack is set up inside a Ruby on Rails application to generate a concatenated, unminified JavaScript file composed of a couple dozen modules. Most of those modules are ReactJS components, and are parsed by the jsx
loader. The output from Webpack is then included in the application.js
file along with some other JavaScript libraries generated by gems.
When I use eval-source-map
, there is no problem. Something about the use of inline-source-map
causes the line numbers to be thrown off by one.
Inspecting JavaScript that is not a React component still has this issue, so I don't think it's related to the use of jsx.
Share Improve this question edited Jul 27, 2015 at 12:14 Markus Köhler 8042 gold badges9 silver badges20 bronze badges asked May 22, 2014 at 1:40 paradasiaparadasia 1,0817 silver badges7 bronze badges 7 | Show 2 more comments2 Answers
Reset to default 3There was a bug in chrome, try the latest version, also on your webpack config try using different sourcemaps on devtool try all of these to see if one works for inline source map:
inline-source-map
cheap-inline-source-map
for other different configs:
cheap-source-map
cheap-module-source-map
cheap-module-eval-source-map
on webpack config:
{
...
devtool:'source-map'
...
}
Configuring with devtool: 'inline-module-source-map'
into webpack fixed my issues.
0
and the other considers it line1
. You may just have to pick one definition, and adjust the value for anything that works the other way. – Carl Younger Commented Jun 7, 2014 at 13:35column
arg in the following code is passed in 1 too high:window.onerror = function(message, url, line, column){}
. Decrementing it fixed that. Note: That's Chrome specific, I don't know about other browsers. – Carl Younger Commented Jun 8, 2014 at 16:34