Fork me on GitHub
#cider
<
2019-10-21
>
Lucas Barbosa01:10:50

Hey folks! I am having troubles to make cider and shadow-cljs play nice together. When I perform a cider-jack-in-cljs from the shadow-cljs.edn file, I get a repl working. However, I cannot evaluate code inside .cljs files, nor switch to the repl buffer. I get a message saying: No cljs REPLs in current session "clojure/app:localhost:62659". More info in the thread.

Lucas Barbosa01:10:14

Project structure:

.
├── shadow-cljs.edn
└── src
    └── my
        └── app.cljs
shadow-cljs.edn:
{:dependencies
 []

 :source-paths
 ["src"]

 :builds
 {:app {:target     :browser
        :output-dir "public/js"
        :asset-path "/js"
        :modules    {:main {:entries []}}}}

 :dev-http
 {8000 "public"}}
my/app.cljs:
(ns )

Lucas Barbosa01:10:46

repl buffer:

[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (134 files, 1 compiled, 0 warnings, 1.92s)
To quit, type: :cljs/quit
[:selected :app]WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
shadow.user>  

pez04:10:42

Have you connected to the app with the browser?

Lucas Barbosa13:10:07

Yep! Screen Shot 2019-10-21 at 10.04.39 (3).png

Lucas Barbosa13:10:40

When I cider-switch-to-repl-buffer from the shadow-cljs.edn file, It transports me to the repl buffer

Lucas Barbosa13:10:14

If I do it from a cljs file, it says No cljs REPLs in current session "clojure/acme-app:localhost:55074"

Lucas Barbosa13:10:25

(This is anothe sample project btw)

Lucas Barbosa13:10:40

I got in through a cider-jack-in-cljs -> localhost -> 55074 -> shadow -> :frontend

pez14:10:20

The web page is blank. It's your app showing a blank page?

Lucas Barbosa14:10:18

Yes, the html only has a script tag referencing the javascript build result

Lucas Barbosa14:10:44

I am just trying to setup a development environment

pez14:10:37

What do you have in the console of that page?

Lucas Barbosa14:10:56

a "Hello World" from my init-fn and two shadow-cljs messages, one saying "websocket connected" and other saying "repl session start successful"

Lucas Barbosa14:10:42

I can evaluate code at the repl buffer in Emacs. It sends the code to the browser and gets the result back. What I cant't do is evaluate code in the cljs buffer

pez14:10:30

Which version of shadow-cljs is this?

Lucas Barbosa14:10:31

I can't also perform a cider-switch-to-repl-buffer. It says "No cljs REPLs in current session", even though there is one

Lucas Barbosa14:10:52

One important detail is that the repl buffer says "clojure" instead of "clojurescript"

Lucas Barbosa14:10:22

> Which version of shadow-cljs is this? [email protected]

pez14:10:40

Try with 2.8.52

pez15:10:05

It's a temporary glitch in shadow right now. Being worked on.

thheller16:10:56

so apparatently cider-nrepl will clone the nREPL session after it has been upgraded to CLJS. can anyone tell me why? pretty sure that most things aren't cloneable in a CLJS session

thheller16:10:19

ie. sending 1 to one CLJS session and 2 to the clone will still affect the *1 of the first

pez16:10:06

Is it cider-nrepl or cider that does this? Cider, right?

thheller16:10:33

hmm right, no clue. could be cider or cider-nrepl