shadow-cljs icon indicating copy to clipboard operation
shadow-cljs copied to clipboard

Safari Source Maps

Open maxweber opened this issue 5 years ago • 0 comments

First of all thank you so much for this excellent tool.

Our new app should also run in Safari. I've noticed that Safari did not show the CLJS sources, despite the fact that source maps are enabled by default in Safari. I found this ClojureScript example, where source maps are working:

https://tromey.github.io/source-map-examples/clojurescript/index.html

Therefore I searched for what shadow-cljs does differently. I found this comment:

;; don't use evalLoad in worker, source maps don't work and not sure why ;; guess it doesn't support sourceURL or sourceMappingURL would require full url? ;; can't seem to get it to work right with eval. works fine when just loading files

Due to this code I added:

:devtools {:loader-mode false}

to my shadow-cljs.edn :builds entry to disable the usage of evalLoad. With this change source maps are working in Safari. Maybe the quickest "fix" is to add this gotcha to the shadow-cljs documentation.

maxweber avatar Apr 11 '20 17:04 maxweber