danvk / source-map-explorer

Analyze and debug space usage through source maps
Apache License 2.0
3.82k stars 100 forks source link

Error: consumer.computeColumnSpans is not a function #190

Open souenzzo opened 4 years ago

souenzzo commented 4 years ago

Description I get non-descriptive error when I try to generate.

Steps to reproduce

  1. git clone https://github.com/souenzzo/eql-realworld-example-app && cd eql-realworld-example-app
  2. git checkout 7c167137e0a080d8ea27b5ec84ede8bc038326a4
  3. npx source-map-explorer@2.4.2 conduit/*.js
  4. You will get:
    conduit/main.js
    consumer.computeColumnSpans is not a function

Files to reproduce Included on steps

Expected behavior I expected an output

Environment

Additional context

This bundle is a clojurescript bundle generated via shadow-cljs, that do some tricks to make node_modules work with closure-compiler in advanced mode.

mikekap commented 4 years ago

I ran into this too - this seems to be a bug in the latest released version of the source-map package. If you install source-map from the git repo (and remove the copy under source-map-explorer's node_modules), it seems to get further.

souenzzo commented 4 years ago

The "lastest released" version of source-map was 2 years ago https://www.npmjs.com/package/source-map I see that my package-lock.json was using 0.7.3

Bumping to 0.8.0-beta.0 I get

conduit/main.js
  Your source map refers to generated column Infinity on line 3, but the source only contains 512 column(s) on that line.
  Check that you are using the correct source map.

Downgrade to 0.7.2 I get

gh-pages/conduit/main.js
  consumer.computeColumnSpans is not a function

Down to 0.6.1

gh-pages/conduit/main.js
  consumer.computeColumnSpans is not a function

I will try to "just parse" my source-maps using source-map directly to see if get better error messages, but it's working on FF/ChromX

mikekap commented 4 years ago

Yea unfortunately shadow-cljs generates partially invalid source maps. Try passing --no-border-checks to source-map-explorer which will just skip the check.

souenzzo commented 4 years ago

How can I know more info about who invalid these source-maps are? I can try to fix it at shadow-cljs side.