Fork me on GitHub
#spacemacs
<
2017-12-14
>
justinlee05:12:43

Hi all. I'm new to clojure and spacemacs. I was trying to connect to an nREPL server that I created using boot-cljs-repl. I'm getting a NPE that seems to be coming weasel and boot_cljs_repl in the main cider-repl buffer. I am also getting a LispReader ReaderException in the cider-error buffer. I'm thinking that the NPE is actually coming from the server and the reader error is coming from cider, but it is awfully hard to tell what's going on here. Any ideas of how to debug?

justinlee05:12:26

I should add that the NPE throws after I run (start-repl)

practicalli-john12:12:44

Hello @lee.justin.m welcome to Clojure & Spacemacs. Sorry, I mostly use Leiningen build tool for my Clojure projects, although boot is on the todo list. If you have Leiningen, you could create a simple project with lein new myproject and use cider-jack-in command in Spacemacs to test you Clojure layer in Spacemacs is working.

practicalli-john12:12:20

@lee.justin.m the basic steps for starting a boot project, or connecting to a boot project started on the command line are covered in https://cider.readthedocs.io/en/latest/up_and_running/

vuuvi16:12:47

is there a way to reverse search in the cider repl?

vuuvi16:12:01

the same as a ctl-r in the terminal?

chris16:12:17

M-r maybe?

chris16:12:35

It seems like it does a reverse regex search and pastes the results in the buffer

chris16:12:54

bound to cider-repl-previous-matching-input

vuuvi16:12:50

okay I’ll give it a go

chris16:12:11

it doesn't work quite as well because it doesn't really cycle as far as I can tell

vuuvi18:12:42

yeah it wasn’t working very well for me

justinlee18:12:12

Thanks @jr0cket. I tried going down that path but now I think I'm hopelessly confused. Although I can run lein repl and then get cider to connect to that, what I was trying to do was to work through the modern-cljs tutorial to get a repl to connect to the browser. In both the boot and lein versions of the tutorial, I can get to a point where I can type (js/alert "hi") and get a popup in the browser using the terminal-based nrepl clients. But I can never figure out what to do to get cider to do that. I think there is some kind of proxying going on but I just can't figure out what. I think I should just use the terminal-based repl for now. Cut-n-paste isn't that hard. 🙂

chris18:12:39

getting cljs repls in cider has always been kinda touch and go

chris18:12:13

I was able to get it to work in both lein and boot, but it took a lot of finagling, and I don't even think what I have would work for a different environment

chris18:12:21

I would just stick with terminal repl for a bit

chris18:12:36

clojure repls have always been rock solid with cider

justinlee18:12:44

coming back to lisp after so many years away makes me remember how glorious and infuriating it is 🙂

justinlee21:12:23

for the record, I got it working but the problem had nothing to do with spacemacs or cider

vuuvi21:12:40

that’s good to hear!