datahike

jumraiya 2026-06-19T16:13:39.747789Z

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)

jumraiya 2026-06-19T16:39:57.688939Z

I'm not well versed in clojurescript so I wonder if I am calling the library in the wrong context.

whilo 2026-06-22T00:54:02.199519Z

Thanks, reproduced, it is because of the new await handling in cljs. I might change the async + await naming to avoid clashes like this.

whilo 2026-06-22T01:29:25.053289Z

One simple way to work around it seems to be to use partial-cps under an alias, like pcps/await.

whilo 2026-06-22T05:08:18.885169Z

For pss I will have to fix this ofc.

jumraiya 2026-06-22T12:54:50.431719Z

Sounds good, thanks.

whilo 2026-06-25T18:05:37.479429Z

Should be fixed in the latest partial-cps and persistent-sorted-set releases.

🎉 1
whilo 2026-06-21T09:47:18.626559Z

It looks like you are lacking a surrounding async, but not sure. Do you have a full code example to reproduce?

jumraiya 2026-06-21T15:42:30.645239Z

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.