cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
2020-12-24T03:06:42.394Z

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?

2020-12-24T03:07:53.394600Z

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

2020-12-24T03:09:35.395200Z

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

dpsutton 2020-12-24T03:15:57.395900Z

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

2020-12-24T03:59:14.397200Z

That was copied from *Messages* in emacs

2020-12-24T04:00:45.398100Z

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.

2020-12-24T04:04:28.400Z

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?

2020-12-24T04:06:22.400700Z

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

dpsutton 2020-12-24T04:08:50.401500Z

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

2020-12-24T04:13:19.403300Z

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.

2020-12-24T04:14:01.403600Z

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"]'

2020-12-24T04:16:03.404300Z

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”] }`

2020-12-24T04:21:22.406Z

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

dpsutton 2020-12-24T04:21:30.406400Z

Did you run the node process?

2020-12-24T04:22:12.407700Z

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

dpsutton 2020-12-24T04:22:14.407800Z

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

dpsutton 2020-12-24T04:22:32.408400Z

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

2020-12-24T04:23:05.408900Z

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

2020-12-24T04:23:34.409300Z

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

dpsutton 2020-12-24T04:27:27.409900Z

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

dpsutton 2020-12-24T04:27:44.410500Z

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

2020-12-24T04:27:55.410900Z

FYI I’m going from this: https://docs.cider.mx/cider/cljs/figwheel.html

2020-12-24T04:28:08.411200Z

Yes, I’m familiar with the repl stuff.

2020-12-24T04:28:57.411800Z

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

2020-12-24T04:30:54.412500Z

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

dpsutton 2020-12-24T04:32:50.412900Z

Don’t try different repls. Use the figwheel option

dpsutton 2020-12-24T04:32:57.413200Z

That will compile your stuff

dpsutton 2020-12-24T04:33:12.413700Z

Then run “node my-file.js”

2020-12-24T04:35:52.414900Z

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

dpsutton 2020-12-24T04:36:18.415800Z

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

2020-12-24T04:36:38.416700Z

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

dpsutton 2020-12-24T04:36:43.417Z

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

dpsutton 2020-12-24T04:37:40.418Z

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

2020-12-24T04:37:45.418200Z

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

2020-12-24T04:38:02.418500Z

As opposed to a figwheel repl.

2020-12-24T04:38:58.419400Z

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

2020-12-24T04:41:58.420100Z

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

2020-12-24T04:59:21.420300Z

FYI submitted an issue https://github.com/clojure-emacs/cider/issues/2954

2020-12-24T04:59:42.420900Z

@dpsutton Thanks for trying to figure this out.

2020-12-24T05:40:16.422Z

@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.