When running conjure with a shadow-cljs project, I'm connecting to the right nREPL session successfully, selecting the correct shadow cljs build successfully, however when I try to run any code or evaluate a buffer I'm getting a lot of errors thrown along the lines of No such namespace: js
. It's also complaining about my ns
form (`Syntax error macroexpanding clojure.core/ns`) which is valid and can't seem to find cljs namespaces No such var: cljs.reader/read-string
.
It seems to me like it's just not running JS code, but I can't figure out why after connecting to a shadow cljs session it wouldn't run cljs code
I run :ConjureConnect
and :ConjureShadowSelect frontend
and get the following output:
; --------------------------------------------------------------------------------
; localhost:3434 (disconnected)
; --------------------------------------------------------------------------------
; localhost:3434 (connected)
; --------------------------------------------------------------------------------
; shadow-cljs (select): frontend
; (out) To quit, type: :cljs/quit
[:selected :frontend]
I've loaded the browser page (connecting the browser repl) and running commands from a npx shadow-cljs cljs-repl frontend
command is successful. Anyone have any tips on investigating why conjure is not running in a cljs environment?
Hmm let me try to reproduce just in case something is very wrong.
@bendy I just tried out shadow myself with the latest version and it's working fine for me :thinking_face: it kind of sounds like you're evaluating ClojureScript into a Clojure nREPL... maybe?
I started up a shadow-cljs server, connected (automatically) over nREPL, selected my "app", opened my browser. Then I could evaluate fine.
So I guess either a version difference in nREPL / shadow / cljs etc has caused an issue or it's something in your setup?
For reference, I use npx shadow-cljs watch app
with this shadow-cljs.edn
{:source-paths
["dev/clojure/src"]
:dependencies
[[cider/cider-nrepl "0.24.0"]]
:dev-http {8080 "dev/clojure/public"}
:builds
{:app {:target :browser
:output-dir "dev/clojure/public/js"
:asset-path "/js"
:modules {:main {:entries [dev.sandbox]}}}}}
Very strange. It does seem like I'm evaluating into a clj repl - even trying to evaluate (js/console.log "hello world")
fails for me saying js is not defined
However Conjure says that it's connected to the same port that shadow cljs is running on, and running a cljs-repl
via shadow-cljs connects to the same port and executes (js/console.log "hello world")
just fine
Not sure what I could have done wrong here but I'll work on it this week! I'll try and report back haha