Need help debugging "index" source map "bug"?

85 views
Skip to first unread message

Thomas Heller

unread,
Nov 6, 2015, 11:44:36 AM11/6/15
to Google Chrome Developer Tools
Hey,

I'm trying to concatenate some JS files and create an index source map [1] for that generated file with links to the source maps of the files instead of including the source map directly. That however does not seem to work as expected (or I am doing it wrong).

Here is what I have:


in the console I get a message of "hello world" at "app.js:41594", which should be a link to the source mapped file "app.cljs:3".

The included .js file (large file 1.6MB) ends with the proper sourceMappingURL
http://thheller.com/index-source-map/compact/js/app.js
//# sourceMappingURL=src/app-index.js.map?r=0.9348894968898759

chrome correctly downloads:
http://thheller.com/index-source-map/compact/js/src/app-index.js.map?r=0.9348894968898759

but then something breaks, if I do devtools inception (open the devtools on the devtools) I get this error:

"Cannot read property 'sources' of undefined" at inspector.js:6556

which either means my source map is incorrect or devtools doesn't support it. I do not quite know how to debug this any further. I think the source map is correct and if I manually follow all the urls they all download correctly. Chrome however never attempts to get [2] which the index map refers to.

The not-concatenated file [3] works correctly and logs with the expected source location of "app.cljs:3".

So the question is

a) is my source map correct?
b) are index source maps with url even supported?

Thoughts? It is kinda hard to google this topic ...

Cheers,
/thomas

Andrey Lushnikov

unread,
Nov 6, 2015, 1:09:45 PM11/6/15
to google-chrome-...@googlegroups.com
Hi Thomas, 

1. As far as I can say, your sourcemap is correct.
2. Unfortunately, the "url" is not supported in index source maps ATM.

I've filed a bug: https://code.google.com/p/chromium/issues/detail?id=552455, feel free to star to get updates on it.

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/1845b18d-69b7-4355-bd1f-2b8ccc04694a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Heller

unread,
Nov 6, 2015, 3:47:06 PM11/6/15
to Google Chrome Developer Tools, lush...@chromium.org
Thanks for the update.

I switched to inlining the map(s) for now as no browser seems to support the url property. Using the map property works as expected, at least in Chrome.

Would still be great to see "url" implemented since creating the inlined map is pretty expensive due to excessive json parsing/merging. Will keep an eye on the issue.

Thanks again,
/thomas

To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages