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

Author: Fantashit

6 thoughts on “When there’s a broken sourcemap, error doesn’t tell you which file it broke on

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

  2. "devDependencies": {
        "webpack-sources": "1.0.1"
    

    In package.json, then npm install, then webpack worked for me.

Comments are closed.