Fork me on GitHub
Christian Johansen08:05:10

I generated a source map for my advanced compiled production build and put it in production. However, it's not fully working - the browser recognizes the source map, and stack traces now include the right file names and line numbers, but the symbols/names are still mangled. Also, when I click on a file location, the source is empty. Any pointers?


@christian767 the original sources can't be resolved - that's all


you've either put them in the wrong place, or you didn't deploy them

Christian Johansen09:05:15

ah, so the sources need to go out as well

Christian Johansen09:05:32

I thought all the required information was embedded in the sourcemap

Christian Johansen09:05:51

will deploying the sources help the browser resolve the names as well?


no source map just does mapping


you can't magically embed all that source 🙂


well you could include sourcesContent in the source map

Christian Johansen10:05:26

I guess 🙂 Well, copying the sources over solved the navigation, but the symbols on the left are still garbled


@christian767 if you are debugging :advanced issues setting :pseudo-names true is very helpful since it makes the names actually somewhat readable

Christian Johansen10:05:09

Ok, thanks. I'll try that. I expected that source maps would know to translate PZ to taoensse.timbre/log, but that's perhaps hoping for too much?


that might just be a limitation of the browser not doing that translation


the source map in theory contains all that info


but doing that translation is quite costly so browser probably just don't do it at that level

Christian Johansen10:05:48

yes, I thought that info was in the source map


:advanced also changes the code in pretty dramatic ways .. so it might just not be possible to map it back


for debugging use :pseudo-names (with or without source maps)

Christian Johansen10:05:16

does that affect build size dramatically?


definitely don't deploy that. only use it for debugging.

Christian Johansen10:05:04

I'm trying to improve insight into production faults 🙂

Christian Johansen10:05:52

thanks for your input @thheller @dnolen! Much appreciated

Christian Johansen10:05:10

btw, does anyone know of tools for parsing source maps on the JVM? Something like this, just for the JVM:


yeah, there is something in the closure compiler for that. its just not well documented. see

Christian Johansen10:05:15

@thheller where does come from?

Christian Johansen10:05:37

you don't also happen to know where to look for stack trace parsing utilities in closure?


there aren't any since each browser has its own format


there are some utils in CLJS

Christian Johansen10:05:31

I would've thought they had a decent cross-browser implementation in closure

Christian Johansen10:05:00

ooh, it works on the JVM too, awesome


there might be .. just not anything I'm aware of 🙂

Christian Johansen10:05:45

very helpful, you've saved me/us loads of time today


that screams monad to me, but afaik monads are not the clojure way, so what would be the clojure way ?