Fork me on GitHub
#shadow-cljs
<
2020-02-18
>
simongray08:02:20

Every time I run shadow-cljs watch app unit-tests I get these warnings in the JS console:

DevTools failed to parse SourceMap: 
DevTools failed to parse SourceMap: 
...
DevTools failed to parse SourceMap: 
DevTools failed to parse SourceMap: 
DevTools failed to parse SourceMap: 
The same problem was there before I made the unit-tests build, so I’m wondering why this even shows up. There is otherwise no mention of devtools in my setup. shadow-cljs.edn:
{:deps     {:aliases [:shadow-cljs :testing]}
 :dev-http {8000 "classpath:public"}
 :nrepl    {:port    9000
            :init-ns dev}
 :builds   {:app        {:target     :browser
                         :output-dir "resources/public/js/compiled"
                         :asset-path "js"
                         :modules    {:main {:init-fn user/start-dev}}}
            :unit-tests {:target   :browser-test
                         :test-dir "resources/public/js/test"
                         :devtools {:http-port 8001
                                    :http-root "resources/public/js/test"}}}}
deps.edn
{:paths   ["src" "resources"]
 :deps    {org.clojure/clojurescript {:mvn/version "1.10.597"}
           reagent                   {:mvn/version "0.9.1"}
           hickory                   {:mvn/version "0.7.1"}}
 :aliases {:testing     {:extra-paths ["test"]}
           :shadow-cljs {:extra-paths ["dev/src"]
                         :extra-deps  {thheller/shadow-cljs {:mvn/version "2.8.83"}}}}}

simongray09:02:26

Removing the portion with :devtools in shadow-cljs.edn or simply only running the app build, just breaks the unit-tests build and doesn’t mute the warnings anyway.

simongray09:02:33

There is one more piece of information which is that I tried to set up a binaryage/devtools preload at some point, but didn’t commit to it and removed it again. I can’t remember if this issue was present before then or not, but is it possible that shadow-cljs has cached something along the way there?

thheller09:02:12

@simongray looks like your paths are incorrect? you have :output-dir "resources/public/js/compiled" and classpath:public meaning that the files are accessed via /js/compiled/... but you have :asset-path "js" which likely should be /js/compiled if you have any kind of client side routing

simongray10:02:09

Thank you!! 🙂 Changing it to

:asset-path "/js/compiled"
did the trick

paul a14:02:41

i'm trying to require some CLJC macros in my browser-targeting CLJS tests so that i can run some hacky code at compile time. i'm using shadow-cljs for my test builds, and i'm getting a build error without a stack trace; it just says Error in phase :compilation.

paul a14:02:42

okay, so i'm trying that, and i'm still getting the same error...

knubie15:02:35

do source maps work with exceptions on react native? They seem to work with console logging, but not for stack traces

jjttjj17:02:52

not positive if this is a problem I'm having with shadow, but when using :deps true in shaodow, are there any issues with using local dependencies using :local/root ? It seems to not be recognizing macro namepsaces in the local dependencies

thheller17:02:26

should work fine

jjttjj17:02:34

Nevermind sorr

jjttjj17:02:02

it seems an extenal thing I was using was using refer instead of refer-macros

jjttjj17:02:26

shadow has no special behavior relating to the refering of macros right?

thheller19:02:50

not sure what you mean