clingen-data-model / curator

0 stars 0 forks source link

Resolve SourceMap warnings in js console #16

Closed theferrit32 closed 3 years ago

theferrit32 commented 3 years ago

A lot of the following type of warnings for different files clutter up the js console. The content of the files it loads are html which it seems to be trying to parse as json.

DevTools failed to load SourceMap: Could not parse content for http://localhost:8080/public/js/cljs-runtime/goog.html.trustedtypes.js.map: Unexpected token < in JSON at position 0

There's probably some way to resolve this in the build options:

https://shadow-cljs.github.io/docs/UsersGuide.html#compiler-options

theferrit32 commented 3 years ago

Commenting out :asset-path from the build object in shadow-cljs.edn resolved this and allowed browsing into .cljs files from Chrome Dev Tools, which is nicer than the minified JS. Commenting this out might have caused other issues, I don't know. Will look into it further whether :asset-path is necessary if it is the same as :output-dir.

https://github.com/clingen-data-model/curator/blob/3dafd26ebfebc5bad09843343717c12a329d7a2a/shadow-cljs.edn#L11

theferrit32 commented 3 years ago

Just flagging these options as well in the build object, but I'm not seeing an effect. I think it is just related to the asset-path.

:compiler-options {:source-map true
                                   :source-map-include-sources-content true
                                   :source-map-detail-level :all}