I'm running into a compilation error when using persistent-sorted-set in cljs. I'm using the latest cljs version.
------ ERROR -------------------------------------------------------------------
File: jar:file:/Users/jumraiya/.m2/repository/org/replikativ/persistent-sorted-set/0.4.122/persistent-sorted-set-0.4.122.jar!/org/replikativ/persistent_sorted_set/branch.cljs:33:15
--------------------------------------------------------------------------------
30 | (and (some? (.-addresses node))
31 | (some? (aget (.-addresses node) idx))))
---------------------^----------------------------------------------------------
Encountered error when macroexpanding is.simm.partial-cps.async/async.
AssertionError: Assert failed: await can only be used in async contexts
(:async &env)
cljs.core/await (core.cljc:976)
cljs.core/await (core.cljc:975)
clojure.lang.Var.applyTo (Var.java:707)
clojure.core/apply (core.clj:671)
clojure.core/apply (core.clj:662)
is.simm.partial-cps.ioc/expand-macro (ioc.clj:37)I'm not well versed in clojurescript so I wonder if I am calling the library in the wrong context.
Thanks, reproduced, it is because of the new await handling in cljs. I might change the async + await naming to avoid clashes like this.
One simple way to work around it seems to be to use partial-cps under an alias, like pcps/await.
For pss I will have to fix this ofc.
Sounds good, thanks.
Should be fixed in the latest partial-cps and persistent-sorted-set releases.
It looks like you are lacking a surrounding async, but not sure. Do you have a full code example to reproduce?
deps.edn
{:paths ["src" "resources"]
:deps {thheller/shadow-cljs {:mvn/version "3.4.11"}
org.replikativ/persistent-sorted-set {:mvn/version "0.4.123"}}
:aliases
{:cljs-pin
{:override-deps {org.clojure/clojurescript {:mvn/version "1.12.145"}}}}}
shadow-cljs.edn
{:deps {:aliases [:cljs-pin]}
:builds
{:pss-test {:target :browser
:modules {:main {:entries [pss-test.core]}}
:compiler-options {:warnings {:invalid-arithmetic false}}
:release {:compiler-options {:optimizations :simple}}}}}
src/pss_test/core.cljs
(ns pss-test.core
(:require
[org.replikativ.persistent-sorted-set :as sset]))
(sset/sorted-set)
I was able to get around it by downgrading the clojurescript version, there is probably a incompatibility with how the latest cljs version implements async.