Fork me on GitHub
#cider
<
2018-05-22
>
rahulr9206:05:01

(Reposting in #nrepl and #cider as per recommendation from #beginners channel) I am getting the following error while trying to load a buffer to my (remote) REPL: Exception in thread "nREPL-worker-0" java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'clojure.tools.nrepl.transport/Transport found for class: clojure.tools.nrepl.middleware.load_file$wrap_load_file$fn$reify__668 Complete stack trace: https://pastebin.com/fafec0AV My profiles.clj:

{:repl {:plugins [[cider/cider-nrepl "0.17.0-SNAPSHOT"]
                    [refactor-nrepl "2.4.0-SNAPSHOT"]]
          :dependencies [[org.clojure/tools.nrepl "0.2.12"]]
          }
   }
Effectively none of my required namespaces are getting loaded. Any help/pointers would be helpful. TIA.

bozhidar06:05:22

@rahulr92 Seems like some dependency issue. Why did you create a separate profile for the repl, btw?

bozhidar06:05:34

How exactly are you booting your server?

rahulr9206:05:12

@bozhidar I created the :repl profile to mitigate warnings of cider complaining about cider-nrepl versions as per http://cider.readthedocs.io/en/latest/troubleshooting/#cider-complains-of-the-cider-nrepl-version I am booting my server as follows: lein repl :headless :host <hostname> Then I am connecting to that instance from my local emacs (Spacemacs) using cider-connect.

bozhidar06:05:41

@rahulr92 What exactly is the version mismatch warning you’re getting otherwise?

rahulr9207:05:10

@bozhidar This is the error if I remove the repl profile:

WARNING: CIDER's version (0.17.0-snapshot) does not match cider-nrepl's version (nil). Things will break!
         More information.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0-SNAPSHOT (package: 20180316.1000) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.

bozhidar07:05:41

Of course. I’m asking dumb questions early in the morning.

bozhidar07:05:55

I’m puzzled by this error you’ve gotten. Have never seen it before and your setup seems correct.

bozhidar07:05:31

You can check lein deps :tree. Maybe something’s wrong with the deps resolution.

rahulr9210:05:50

I get the error without the repl profile too. On running lein deps :tree :

lein deps :tree
 [clojure-complete "0.2.4" :exclusions [[org.clojure/clojure]]]
 [org.clojure/tools.nrepl "0.2.12" :exclusions [[org.clojure/clojure]]]

bozhidar12:05:31

That’s fine. Those come from lein itself.

bozhidar13:05:15

https://github.com/nrepl/drawbridge is now depending on the new nREPL 0.4 and I’ve patched reply as well https://github.com/trptcolin/reply/pull/182

bozhidar13:05:35

This migration is so much work…

bozhidar13:05:55

That’s the last time I sign up for something like this. 😄

dominicm13:05:45

don't break stuff then... 😉

bozhidar13:05:10

Anyways, now the last bit is providing a boot and lein tasks in cider-nrepl to use the new nREPL. @richiardiandrea @dominicm Interested in helping with those?

bozhidar13:05:53

@dominicm 😉

dominicm13:05:01

I'm surprisingly busy in the short-term I'm afraid.

bozhidar13:05:29

Understood.

richiardiandrea15:05:34

@bozhidar what should the boot task do? Sorry I was a bit out of the loop

bozhidar15:05:43

@richiardiandrea Basically it needs to start the new nREPL (0.4+) instead of the one bundled with Boot. I think you’re also on Boot’s team, so you might be able to help with the nREPL update there.

richiardiandrea17:05:02

question, is this task for boot core or it should go somewhere else?

richiardiandrea17:05:33

☝️ @bozhidar

bozhidar17:05:57

@richiardiandrea Both.

richiardiandrea17:05:06

which one first and where 😄

bozhidar17:05:35

It should go to boot-core, but as not everyone will be on the latest boot, it might be good to have this as some task in cider-nrepl as well.

bozhidar17:05:36

I also wonder how we can make things painless for people stuck with some legacy middleware using boot-core. Ideally there should be some param to choose whether you want to start the new nREPL server or the legacy one.

bozhidar17:05:10

For a cider-nrepl task - you just have to be able to start the new one and inject whatever deps/middleware is needed.

bozhidar17:05:30

boot cider-repl ...

richiardiandrea17:05:56

so usually I have a task called cider

richiardiandrea17:05:24

(deftask cider "CIDER profile"
  []
  (require 'boot.repl)
  (swap! @(resolve 'boot.repl/*default-dependencies*)
         concat '[[org.clojure/tools.nrepl "0.2.13"]
                  [cider/cider-nrepl "0.16.0"]
                  [refactor-nrepl "2.4.0-SNAPSHOT"]])
  (swap! @(resolve 'boot.repl/*default-middleware*)
         concat '[cider.nrepl/cider-middleware
                  refactor-nrepl.middleware/wrap-refactor])
  identity)

richiardiandrea17:05:31

I can expand on this

richiardiandrea17:05:31

of course passing parameters in

richiardiandrea17:05:10

so the only thing we need is a small wrapper to the new namespace

richiardiandrea17:05:43

because then we can do boot add-middleware ..... new-nrepl

richiardiandrea18:05:47

it is definitely deeper than just a task, because we use boot-cljs-repl with boot

richiardiandrea18:05:59

so I will have to continue another time 😉

bozhidar15:05:59

I was thinking that upstream they can add an extra task to spin the new nREPL instead of the legacy one (the package names and the classes are different, so there can be no conflicts between them).

dominicm15:05:14

@richiardiandrea boot-cljs-repl needs updating too

richiardiandrea15:05:42

Ok I will try my best

bozhidar15:05:39

@richiardiandrea Much appreciated!

benedek17:05:21

Do we need to update that in refactor-nrepl too?

bozhidar18:05:19

@benedek Certainly. The old namespace is gone, so the code has to be updated to use the new one - clojure.tools.nrepl.* -> nrepl.*.

bozhidar18:05:09

This change is trivial, the only problem is that we also need simple way to boot the new server, so it would work with the updated middleware, as using lein repl and boot repl directly won’t be an option for a while.

bozhidar18:05:02

Basically I see us switching to something like lein cider and boot cider.

benedek18:05:27

also need a release of cljr then

benedek18:05:13

i guess this change is not backward compatible with 0.17 cider