Fork me on GitHub
#conjure
<
2020-08-31
>
bendy12:08:27

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.

bendy12:08:55

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

bendy12:08:38

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]

bendy12:08:46

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?

Olical13:08:27

Hmm let me try to reproduce just in case something is very wrong.

Olical15:08:50

@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?

Olical15:08:25

I started up a shadow-cljs server, connected (automatically) over nREPL, selected my "app", opened my browser. Then I could evaluate fine.

Olical15:08:42

So I guess either a version difference in nREPL / shadow / cljs etc has caused an issue or it's something in your setup?

Olical15:08:32

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]}}}}}

bendy15:08:30

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

bendy15:08:14

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

bendy15:08:53

Not sure what I could have done wrong here but I'll work on it this week! I'll try and report back haha