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?
this is emacs 27.1 on macos catalina, cider version 0.26.1 (Nesebar)
that is, the cljs repl starts when I run cider-jack-in-cljs
Looks unfamiliar to me. Where is that error? In emacs or in the repl?
That was copied from *Messages*
in emacs
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.
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?
standby; just found something on the web recommending a reinstall of cider with emacs restart…
Cider needs a js runtime. If it’s a web app have you opened the correct url in your browser?
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.
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"]'
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”]
}`
Something like this happens literally every time I return to using cider. Sigh.
Did you run the node process?
What do you mean? Doesn’t cider-jack-in-cljs
do that? It must, since loading the file works.
There should be an output file and you should run that file through node
I doubt it’s working. You need to run the node process yourself I think
That doesn’t make sense to me. What would be the point of a repl in that case?
Guess I’ll go back over the figwheel docs, maybe I missed something.
Repl is a live process that’s interactable and evaluate forms
And that file will run the repl when you start the node process
FYI I’m going from this: https://docs.cider.mx/cider/cljs/figwheel.html
Yes, I’m familiar with the repl stuff.
I was using cljs repl type ‘node’. tried it with ‘figwheel-main’ and got the same error.
starting to smell like a figwheel problem, I’ll try a different repl
Don’t try different repls. Use the figwheel option
That will compile your stuff
Then run “node my-file.js”
I’ve done that, builds work. I’m trying to use emacs+cider to develop with a repl, not run compiled files.
Right. The repl is powered by that node process. That’s how it can eval anything
A plain node repl throws the same error, alas, so I guess it isn’t a figwheel problem.
Figwheel should emit repl related code that allows for all of the hot loading and redefinition
I don’t know what you mean a plain node repl
I don’t think the repl is the problem. It is running, I can evaluate code in it. The problem is cider.
As opposed to a figwheel repl.
I.e. when cider startup prompts for a clojurescript repl, ‘node’ instead of ‘figwheel-main’, with figwheel deps removed from deps.edn.
probably a version problem I suppose. that’s what often turns out to be the problem.
FYI submitted an issue https://github.com/clojure-emacs/cider/issues/2954
@dpsutton Thanks for trying to figure this out.
@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.