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

Most upvoted comments

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:

+    "webpack-sources": "1.0.1"
"devDependencies": {
    "webpack-sources": "1.0.1"

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

  ...
"resolutions": {
    "webpack-sources": "1.0.1"
  },

Then

yarn upgrade

No webpack-sources module for me but for those using babili, the following setting solved (temporary) the problem:

"devDependencies": {
    "babili-webpack-plugin": "0.1.1"

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 problem

I 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.