using core async in cljs, if i have the following mounted component:
(defn go-loop []
(async/go-loop []
(<! (async/timeout 1000))
(when (exists? js/window.console)
(js/console.log "can we do this?"))
(recur)))
(defn init []
(enable-console-print!)
(go-loop)
(r/render [:h3 "works in chrome but not IE"] (.getElementById js/document "app")))
this works in chrome and IE when the devconsole is open but throws in async impl when the console is closed.am i doing something I shouldn't? I get IO shouldn't happen from a go-loop but does that include a seemingly innocuous call to console log?
I don't really use cljs, but I think think all your names with dots in them for js stuff may cause you issues
e.g. (js/console.log ...)
should maybe be (.log js/console ...)
let me update
wow i think that solved it. i thought those two forms were equivalent
I think it may happen to work sometimes
but I am really not sure, you might try checking out #clojurescript and see what they say about it
i thought i had seen there was a "preference" for the (.log js/console ...) but thought they were equivalent. Either way thanks. I had been wondering how to strip it down to basic stuff and just didn't think about that
they're equivalent in cljs, but i suspect the cljs core.async analyzer is broken in that case, since it doesn't use the cljs analyzer but a hand rolled one
the bug only happens in IE11 though