Fork me on GitHub
#shadow-cljs
<
2023-05-03
>
Eric Scott14:05:19

I don't play on the cljs side much, but shouldn't this work?

> (require '[cljs.repl :refer [apropos]])
nil
> (apropos "some")
Unexpected error (AssertionError) macroexpanding cljs.repl/apropos at (<cljs repl>:1:1).
Assert failed: (symbol? ns)
This is under cider-repl cljs:node

Eric Scott16:05:24

Same problem with :refer-macros

thheller17:05:07

many of the cljs.repl functions assume some built-in internal compiler thing that shadow-cljs maybe doesn't emulate properly

thheller17:05:18

don't know what it is in this case, feel free to open an issue. can't check right now.

peterdee19:05:06

funcool/promesa has a function 'extract' that isn't found, and I don't see why. I tried the following in a fresh user-id also, so it I don't think it is a problem with my configuration: 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 --------------------------------------------------------------------------------

thheller19:05:14

might be macro?

thheller19:05:11

maybe it was added recently? the source file from that jar doesn't have anything named extract

peterdee20:05:34

It isn't a macro. It has been around a while. The developer tells me that they call it in testing. He hasn't tried the above procedure, though.

peterdee20:05:44

Huh! In the jar the function has #?(:clj wrapped around it. But that isn't what is on the repository. Thanks!