webpack: When there's a broken sourcemap, error doesn't tell you which file it broke on
Do you want to request a feature or report a bug?
UX feature/bug
What is the current behavior?
I’m running webpack on a big project and getting this suddenty:
original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.
But the error doesn’t tell me which file/map is causing this issue. Also hard to debug as I’ve went and put logs in variety of places along the stack trace, but none seem to clue me into which file this is breaking on. I’ve been binary searching to narrow it down to certain node_modules but after an hour no luck, so opening an issue.
If the current behavior is a bug, please provide the steps to reproduce.
Have a bad sourcemap of some sort, and then run webpack.
What is the expected behavior?
Outputting the file it broke on would be immensely helpful!
If this is a feature request, what is motivation or use case for changing the behavior?
Dev UX
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.
Webpack 3.4, Mac, Node 8
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 28
- Comments: 32 (5 by maintainers)
Commits related to this issue
- webpack-sources degrade 1.0.2 > 1.0.1 see: https://github.com/webpack/webpack/issues/5931 — committed to mizar/electron-webpack-quick-start by mizar 7 years ago
- fix source-maps crash related: https://github.com/webpack/webpack/issues/5931 — committed to yldio/joyent-react-scripts by sergioramos 7 years ago
- Workaround for Webpack issue See https://github.com/webpack/webpack/issues/5931#issuecomment-342546103 for details. — committed to ahocevar/geoweb-g06-aufgabe3 by ahocevar 7 years ago
- Temporary fix for webpack sourcemaps: webpack/webpack/issues/5931 — committed to mozilla/naf-janus-adapter by robertlong 7 years ago
- Upgrade node version in travis config. Hopefully fixes https://github.com/webpack/webpack/issues/5931 — committed to CodeForPhilly/philly-ward-leaders by timwis 7 years ago
- Temporary fix for webpack #5931 https://github.com/webpack/webpack/issues/5931 — committed to hql287/Manta by hql287 6 years ago
- Source maps for prod The resolution part is a wrokaround for https://github.com/webpack/webpack/issues/5931#issuecomment-343021923 — committed to meine-stadt-transparent/meine-stadt-transparent by konstin 5 years ago
Are all of you using
babili/babel-minify-webpack-plugin
?yes it related to https://github.com/webpack/webpack-sources/issues/28
fix looking like:
In package.json, then
npm install
, then webpack worked for me.We had to downgrade the transitive dependency webpack-sources from 1.0.2 to 1.0.1
package.json
Then
yarn upgrade
No webpack-sources module for me but for those using babili, the following setting solved (temporary) the problem:
The issue is still open on the babili-webpack-plugin repo: https://github.com/webpack-contrib/babel-minify-webpack-plugin/issues/68
webpack-sources@1.1.0
has ben released and it’s being installed but this release does not affect the problemI have the same issue also. It is definitely related to some broken dependency somewhere, because I could fix it by resetting package-lock.json to last working build. Right now I am going through all the updates of dependencies (and dependencies of dependencies) to figure out exactly what broke this.