Fork me on GitHub
#funcool
<
2023-03-16
>
peterdee19:03:06

Running in shadow-cljs I'm getting an error with promesa (10.0.594) `Use of undeclared Var promesa.core/extract`

niwinz09:03:20

strange, we are using it ourselves and didnt see this warning

niwinz09:03:06

are you using something concrete from promesa that caused this?

peterdee22:04:06

Sorry for the really late reply! I'm using shadow-cljs. A small example demonstrating the problem would be to create a project: npx create-cljs-project promesa-test cd promesa-test npm install Replace the existing shadow-cljs.edn with just this: {:dependencies [[funcool/promesa "10.0.594"]]} and run: npx shadow-cljs browser-repl cljs.user=> (require '[promesa.core :as p]) nil cljs.user=> promesa.core ; See what is exported <<a bunch of stuff but not extract>> cljs.user=> (-> (p/resolved 111) (p/then #(println %))) 111 #<Promise[~]> cljs.user=> (-> (p/resolved 111) (p/extract)) ------ WARNING - :undeclared-var ----------------------------------------------- Resource: <eval>:1:23 Use of undeclared Var promesa.core/extract --------------------------------------------------------------------------------

peterdee22:04:27

Maybe it is a problem with shadow-cljs?

peterdee21:05:58

In the jar in ~/.m2/repository/funcool/promesa/10.0.594/core.cljs the function extract is wrapped in #? :clj. But that isn't what is on github.

peterdee22:04:06

Sorry for the really late reply! I'm using shadow-cljs. A small example demonstrating the problem would be to create a project: npx create-cljs-project promesa-test cd promesa-test npm install Replace the existing shadow-cljs.edn with just this: {:dependencies [[funcool/promesa "10.0.594"]]} and run: npx shadow-cljs browser-repl cljs.user=> (require '[promesa.core :as p]) nil cljs.user=> promesa.core ; See what is exported <<a bunch of stuff but not extract>> cljs.user=> (-> (p/resolved 111) (p/then #(println %))) 111 #<Promise[~]> cljs.user=> (-> (p/resolved 111) (p/extract)) ------ WARNING - :undeclared-var ----------------------------------------------- Resource: <eval>:1:23 Use of undeclared Var promesa.core/extract --------------------------------------------------------------------------------