Fork me on GitHub
#shadow-cljs
<
2020-08-07
>
jysandy11:08:21

From the docs: > Sometimes you will see examples of import Foo from “something” when the code is actually CommonJS code. Just ran into this case recently. However, it looks like if I try to require ... :as after I incorrectly use require ... :default, the require ... :as fails and doesn’t do anything. I had to restart the shadow-cljs watch process and reconnect to get it to work. Is this worth documenting as a gotcha? Spent quite a lot of time debugging, because I thought the CommonJS import was failing as well.

thheller11:08:46

@jysandy hmm yeah thats an issue. the problem is that the first :default will create the DayPicker binding. :as is only taken if there is no other binding by that name since its normally reserved as a namespace alias. not really something I can easily fix. Just use :as first and you won't run into this issue

thanks2 3
benny16:08:01

trying to spin up shadow in cider for the first time in a while and getting the following, any ideas? > Exception in thread “main” java.lang.RuntimeException: Unable to resolve symbol: requiring-resolve in this context, compiling:(shadow/cljs/devtools/cli.clj:70:16)

benny16:08:07

ah looks like since i’m using lein for deps it’s ignoring the dynamic deps

dpsutton16:08:35

what's your clojure version? that function was added in 1.10 and is in clojure.core

thheller16:08:36

@benny just add org.clojure/clojure to your deps in lein, looks like you are getting an older version

benny16:08:01

sweet that’s much better than switching back, thanks @dpsutton @thheller