Fork me on GitHub
#cider
<
2020-12-24
>
mobileink03:12:42

hello. getting (re)started with cider, figwheel, cljs after many months away. the cljs repl starts, and cider-load-file works, but C-x C-e throws the following error: apply: Wrong number of arguments: #[(&optional arg1 arg2 arg3) "ÀÁ\"" [clojure-quick-repls-set-connection nil] 3], 4 [2 times]. Help?

mobileink03:12:53

this is emacs 27.1 on macos catalina, cider version 0.26.1 (Nesebar)

mobileink03:12:35

that is, the cljs repl starts when I run cider-jack-in-cljs

dpsutton03:12:57

Looks unfamiliar to me. Where is that error? In emacs or in the repl?

mobileink03:12:14

That was copied from *Messages* in emacs

mobileink04:12:45

When I place the cursor at the end of (println "This text is printed from src/obazl/core.cljs. Go ahead and edit it and see reloading in action.") and execute cider-eval-last-sexp the message prints in the minibuf.

mobileink04:12:28

Same thing with cider-eval-region. Hmm. cider-load-file does not throw an error, but it also does not print anything to the repl buffer. Oops, just noticed cider[not connected] in the minibuf. Is that normal? If I run cider-jack-in-cljs from a cljs file should it not connect?

mobileink04:12:22

standby; just found something on the web recommending a reinstall of cider with emacs restart…

dpsutton04:12:50

Cider needs a js runtime. If it’s a web app have you opened the correct url in your browser?

mobileink04:12:19

I’m using node. I just redid my emacs init.el and restarted. Now cider-load-file works; the println commands print to the cljs repl buffer. But the cider-eval-… commands throw the same error.

mobileink04:12:01

Here’s the startup cmd: [nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.0"} cider/piggieback {:mvn/version "0.5.1"} cider/cider-nrepl {:mvn/version "0.25.3"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware", "cider.piggieback/wrap-cljs-repl"]'

mobileink04:12:03

In init.el I have (setq cider-default-cljs-repl 'node)` . deps.edn: `{:deps {org.clojure/clojure {:mvn/version “1.10.1”} org.clojure/clojurescript {:mvn/version “1.10.773"} com.bhauman/figwheel-main {:mvn/version “0.2.12”} com.bhauman/rebel-readline-cljs {:mvn/version “0.1.4"} } :paths [“src” “target” “test”] }`

mobileink04:12:22

Something like this happens literally every time I return to using cider. Sigh.

dpsutton04:12:30

Did you run the node process?

mobileink04:12:12

What do you mean? Doesn’t cider-jack-in-cljs do that? It must, since loading the file works.

dpsutton04:12:14

There should be an output file and you should run that file through node

dpsutton04:12:32

I doubt it’s working. You need to run the node process yourself I think

mobileink04:12:05

That doesn’t make sense to me. What would be the point of a repl in that case?

mobileink04:12:34

Guess I’ll go back over the figwheel docs, maybe I missed something.

dpsutton04:12:27

Repl is a live process that’s interactable and evaluate forms

dpsutton04:12:44

And that file will run the repl when you start the node process

mobileink04:12:08

Yes, I’m familiar with the repl stuff.

mobileink04:12:57

I was using cljs repl type ‘node’. tried it with ‘figwheel-main’ and got the same error.

mobileink04:12:54

starting to smell like a figwheel problem, I’ll try a different repl

dpsutton04:12:50

Don’t try different repls. Use the figwheel option

dpsutton04:12:57

That will compile your stuff

dpsutton04:12:12

Then run “node my-file.js”

mobileink04:12:52

I’ve done that, builds work. I’m trying to use emacs+cider to develop with a repl, not run compiled files.

dpsutton04:12:18

Right. The repl is powered by that node process. That’s how it can eval anything

mobileink04:12:38

A plain node repl throws the same error, alas, so I guess it isn’t a figwheel problem.

dpsutton04:12:43

Figwheel should emit repl related code that allows for all of the hot loading and redefinition

dpsutton04:12:40

I don’t know what you mean a plain node repl

mobileink04:12:45

I don’t think the repl is the problem. It is running, I can evaluate code in it. The problem is cider.

mobileink04:12:02

As opposed to a figwheel repl.

mobileink04:12:58

I.e. when cider startup prompts for a clojurescript repl, ‘node’ instead of ‘figwheel-main’, with figwheel deps removed from deps.edn.

mobileink04:12:58

probably a version problem I suppose. that’s what often turns out to be the problem.

mobileink04:12:42

@dpsutton Thanks for trying to figure this out.

mobileink05:12:16

@dpsutton FYI, it turns out there is something in my emacs config that breaks cider. I ran with a minimal emacs init.el and it worked.