Fork me on GitHub
#cider
<
2022-06-02
>
borkdude11:06:31

I'm trying cider-jack-in but I'm getting:

[nREPL] Starting server via /opt/homebrew/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.9.0"} cider/cider-nrepl {:mvn/version "0.28.4"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at nrepl.cmdline/require-and-resolve (cmdline.clj:201).
Could not locate refactor_nrepl/middleware__init.class, refactor_nrepl/middleware.clj or refactor_nrepl/middleware.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

Full report at:
/var/folders/j9/xmjlcym958b1fr0npsp9msvh0000gn/T/clojure-16565661702086264971.edn

error in process sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at nrepl.cmdline/require-and-resolve (cmdline.clj:201).
Could not locate refactor_nrepl/middleware__init.class, refactor_nrepl/middleware.clj or refactor_nrepl/middleware.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.

1
borkdude11:06:55

This is a very basic project, just an empty deps.edn and a src file

magnars13:06:17

I did the same on my machine, and that worked. Mine, however, included refactor-nrepl/refactor-nrepl {:mvn/version "3.2.0"} in the -Sdeps string.

magnars13:06:48

It seems like your --middleware and -Sdeps are not playing nicely with each other, since one includes refactor-nrepl, and the other doesn't. Could be some emacs settings?

vemv13:06:31

This is the whole logic, it should be easy to detect what's wrong https://github.com/clojure-emacs/clj-refactor.el/blob/f368c56c83843396b160440f472a661a3b639862/clj-refactor.el#L4200-L4221 Basically you want either: • refactor-nrepl added to cider-jack-in-dependencies • refactor-nrepl.middleware/wrap-refactor removed from cider-jack-in-nrepl-middlewares

borkdude13:06:18

Note that this all happened automatically. I'm not sure if I added any config that made it behave different than it should

borkdude13:06:41

I don't see anything in my init.el that should mess with this

vemv13:06:22

It would be appreciated if you could eval those simple forms and detect what went wrong :)

borkdude13:06:30

@U45T93RA6 I appreciate you trying to help! Which forms should I evaluate? cljr--inject-jack-in-dependencies) inside an elisp session?

vemv13:06:01

My suggestion is to try determining why cider-jack-in-dependencies doesn't include refactor-nrepl according to those lines of code

vemv13:06:29

I'd simply eval the two conditions for those when s

borkdude13:06:22

ELISP> cljr-inject-dependencies-at-jack-in
t

borkdude13:06:41

ELISP> (fboundp 'cider-add-to-alist)
t

vemv13:06:39

specifically: (and cljr-inject-dependencies-at-jack-in (fboundp 'cider-add-to-alist) (boundp 'cider-preferred-build-tool) (boundp 'cider-jack-in-dependencies) (boundp 'cider-jack-in-lein-plugins) (boundp 'cider-jack-in-nrepl-middlewares))

vemv13:06:45

and (not (eq cider-preferred-build-tool 'lein))

vemv13:06:03

M-: is your friend btw, a repl can have a slightly different context https://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Eval.html

borkdude13:06:32

All of those eval-ed to true

vemv13:06:45

what's the val of cider-jack-in-dependencies?

vemv13:06:33

that's strange, considering the two conditions evaled to true maybe you switched projects as you started Emacs, sth like that? Or otherwise, somehow things evaled differently before (around Emacs init time) and now

vemv13:06:49

(some quick measures: ensure emacs and clj-refactor.el are both at latest stable, and remove .elc files)

borkdude13:06:23

Aaah, that was it. I had to upgrade clj-refactor.el

borkdude13:06:30

Thanks @U45T93RA6 ❤️

🍻 3
vemv13:06:36

yeah breaking changes suck... wish we had fewer of them 😑

daveliepmann12:06:22

I came to the channel to ask about this same issue. Glad to see this thread — thanks folks 🙂 Upgrading from clj-refactor from 3.2.2 to 3.5.2 fixed my environment as well. I suspect this behavior arose when I last upgraded CIDER.

cider 1