conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
2020-08-31T12:46:27.002800Z

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.

2020-08-31T12:46:55.003500Z

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

2020-08-31T12:47:38.004Z

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]

2020-08-31T12:49:46.005600Z

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?

Olical 2020-08-31T13:48:27.006100Z

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

Olical 2020-08-31T15:20:50.007200Z

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

Olical 2020-08-31T15:21:25.007800Z

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

Olical 2020-08-31T15:21:42.008400Z

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

Olical 2020-08-31T15:22:32.008800Z

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

2020-08-31T15:53:30.010600Z

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

2020-08-31T15:54:14.011600Z

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

2020-08-31T15:54:53.012100Z

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