This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-15
Channels
- # announcements (8)
- # asami (10)
- # babashka (16)
- # beginners (86)
- # calva (22)
- # chlorine-clover (9)
- # circleci (20)
- # clj-kondo (13)
- # cljs-dev (20)
- # cljsrn (3)
- # clojure (144)
- # clojure-australia (10)
- # clojure-europe (126)
- # clojure-italy (5)
- # clojure-nl (8)
- # clojure-norway (4)
- # clojure-serbia (9)
- # clojure-uk (7)
- # clojurescript (14)
- # cursive (20)
- # data-science (1)
- # datomic (20)
- # figwheel-main (5)
- # fulcro (23)
- # graalvm (7)
- # graphql (25)
- # honeysql (15)
- # hugsql (3)
- # jobs (2)
- # lambdaisland (2)
- # leiningen (4)
- # lsp (102)
- # malli (3)
- # off-topic (51)
- # overtone (5)
- # pathom (27)
- # portal (11)
- # quil (1)
- # re-frame (19)
- # reagent (31)
- # remote-jobs (1)
- # reveal (3)
- # rewrite-clj (56)
- # shadow-cljs (45)
- # startup-in-a-month (1)
- # tools-deps (9)
Hello. I have weird behavior when comparing native JavaScript Objects with =
in advanced compilation. My app receives a JavaScript object from an npm api. In development (= js-obj nil)
works as expected. But in the advanced copiled code it returns a truthy value when js-obj
is provided. Is this expected behavior or does the =
work the same in normal and advanced compilation and I am missing something else?
Just to add to the above - the only reason that I can think of for why (= js-obj nil)
can return true
in prod and false
in dev is that something got its name mangled up the call chain, and that form does indeed receive nil
.
And if you just need to check for nil
, use nil?
.
Thank you for feedback. I was getting a user object from an auth library multiple times. My goal was to do something when the user changed. So I stored the user in an atom. Then when I received anoter user I "compared" it to the one from the atom. Given (def USER (atom nil))
and a JavaScript object user
. In dev (= user @USER)
returned false
while in production it returned ee
(a JavaScript object) which was truthy. I replaced my comparsion with (identical? user @USER)
and it works now. I really would like to understand this 😞
Given the strangeness of the situation, it's likely that you won't be able to create one from scratch. If that's the case, I'd go the other way - keep removing bits from the actual app till you can't reproduce the issue anymore.
Thank you. I will continue to debug. I posted here, just in case I missed something with the =
operator in ClojureScript.
Hi, Clojurians! Can anyone tell me how to better track down what's going on with an error I'm getting while compiling an uberjar: "java.lang.IllegalArgumentException: No matching clause for: none". It seems like it's coming from a case statement, but the stack trace is completely opaque, and removing the only case statements I wrote doesn't help, so my current hypothesis is that it's coming from some dependency.
looks like you maybe have none
in your CLJS build config somewhere? as in a symbol when it should be a :none
keyword? or well :advanced
for release stuff?
You, sir, are a gentleman and a scholar. I had ":optimizations none", and adding the colon did it.