Fork me on GitHub
#emacs
<
2018-12-05
>
Eccentric J18:12:28

Still wrestling with my issues from yesterday. I’m running lein repl and lein figwheel in a project. I’m connecting to both through spacemacs + cider. Sometimes I can do C-C to send the top-level form under my cursor to the clj repl but in cljs I get that “No CLJS repls in the current session”. Also of note is cider says the cljs repl is indefinitely in a pending state.

Eccentric J18:12:28

In the mean time I’ll read some docs about working with figwheel + cider and see if there’s a step in the process I’m missing. 🙂

dpsutton18:12:22

how do you connect to the cljs repl?

dpsutton18:12:40

cider-connect-cljs?

lispers-anonymous18:12:05

That connects to an existing cljs repl. To start a new one you use cider-jack-in-cljs

orestis18:12:31

In the past I was able to start a CLJS Figwheel REPL just fine from Cider (via jack-in), but I’ve never found how to connect to an already running one. I’m not even sure if Figwheel actually starts a nRepl for you by default.

Eccentric J21:12:47

@dpsutton Correct. cider-connect-cljs

dpsutton21:12:05

and do you have the cider middleware correctly setup?

dpsutton21:12:25

i made a quick function to see what it is invoking without waiting for it

dpsutton21:12:27

(defun cider-copy-jack-in-command ()
  (interactive)
  (kill-new (plist-get (cider--update-jack-in-cmd (cider--update-project-dir '()))
                       :jack-in-cmd)))

Eccentric J21:12:34

@orestis I’m using a luminus template that does start nrepl

Figwheel: Starting nREPL server on port: 7002

dpsutton21:12:44

but you need cider guts

Eccentric J21:12:50

Ok, checking on that now

Eccentric J21:12:42

:figwheel
  {:http-server-root "public"
   :server-logfile "log/figwheel-logfile.log"
   :nrepl-port 7002
   :css-dirs ["resources/public/css"]
   :nrepl-middleware
   [cider/wrap-cljs-repl cider.piggieback/wrap-cljs-repl]}

Eccentric J21:12:58

Should figwheel be a separate section or within profiles?

Eccentric J21:12:36

It seems that cider/wrap-cljs-repl and piggieback are applied

Eccentric J21:12:54

After running cider-copy-jack-in-command I got

/Users/jay/bin/lein update-in :dependencies conj \[nrepl\ \"0.4.5\"\] -- update-in :plugins conj \[com.billpiel/sayid\ \"0.0.17\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0-SNAPSHOT\"\] -- repl :headless :host localhost
but it seemed to have targeted my clj repl and not my cljs repl