Closed fonghou closed 5 years ago
adding (:require [cloroutine.impl]) in async.cljs file appears to resolve it. not sure why it's needed. it may has something to do with shadow-cljs since it tracks cljs namespace dependencies base on these require clauses.
Adding a (:require [cloroutine.core])
clause to the cljs part is required because the cr
macro emits code that relies on a runtime helper function.
I don't recommend requiring cloroutine.impl
directly because it's not part of the public API. cloroutine.core
will transitively require cloroutine.impl
so it should be preferred.
I'm not familiar with shadow-cljs but I doubt it's related to this problem.
I tested the asyncawait.clj/cljs code from here. For some reason, always get below compile error ("cloroutine is not defined" runtime error as well). It might have something to do with the implicit require-macros I did in async.cljs file, but I really couldn't figure out where it went wrong (strangely, no other vars referred by the macro expansion from cloroutine.impl namespace get that error).
src/cloroutine/async.cljs
src/cloroutine/async.clj