nrepl

https://github.com/nrepl/nrepl || https://nrepl.org
markwoodhall 2019-05-14T12:22:56.141300Z

Hi, has anyone come across this before? This setup was previously working fine but now I get the below error when trying to open any ClojureScript file in vim (vim-fireplace). I am using cider-nrepl 0.21.1 and piggieback 0.4.0. I imagine there might be a version mismatch or something but I am not sure where.

Exception in thread "nRepl-session-b1e1107c-001d-4433-8db7-e66291d821f2" java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'nrepl.transport/Transport found for class: nil
        at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:583)
        at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:575)
        at nrepl.transport$eval48462$fn__48463$G__48453__48470.invoke(transport.clj:16)
        at nrepl.middleware.print$replying_PrintWriter$fn__48919.invoke(print.clj:115)
        at nrepl.middleware.print.proxy$java.io.Writer$ff19274a.write(Unknown Source)
        at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129)
        at java.io.BufferedWriter.flush(BufferedWriter.java:253)
        at java.io.PrintWriter.newLine(PrintWriter.java:482)
        at java.io.PrintWriter.println(PrintWriter.java:629)
        at java.io.PrintWriter.println(PrintWriter.java:757)
        at java.lang.Throwable$WrappedPrintWriter.println(Throwable.java:764)
        at java.lang.Throwable.printStackTrace(Throwable.java:655)
        at java.lang.Throwable.printStackTrace(Throwable.java:721)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
        at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
        at cljs.repl$repl_caught.invokeStatic(repl.cljc:809)
        at cljs.repl$repl_caught.invoke(repl.cljc:795)
        at cider.piggieback$repl_caught.invokeStatic(piggieback.clj:105)
        at cider.piggieback$repl_caught.invoke(piggieback.clj:98)
        at cider.piggieback$do_eval.invokeStatic(piggieback.clj:265)
        at cider.piggieback$do_eval.invoke(piggieback.clj:227)
        at cider.piggieback$evaluate.invokeStatic(piggieback.clj:273)
        at cider.piggieback$evaluate.invoke(piggieback.clj:271)
        at clojure.lang.Var.invoke(Var.java:381)
        at cider.piggieback$wrap_cljs_repl$fn__49637$fn__49640$fn__49641.invoke(piggieback.clj:305)
        at cider.piggieback$enqueue$fn__49609.invoke(piggieback.clj:195)
        at clojure.lang.AFn.run(AFn.java:22)
        at nrepl.middleware.session$session_exec$main_loop__49154$fn__49158.invoke(session.clj:171)
        at nrepl.middleware.session$session_exec$main_loop__49154.invoke(session.clj:170)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.lang.Thread.run(Thread.java:748)

bozhidar 2019-05-14T12:25:19.142600Z

I think @pez mentioned a similar problem (take a look at this history).

pez 2019-05-14T12:25:28.143Z

Yes, I've seen it often with the dev build of Calva, which seems to provoke this thing often. I have failed to trace it down, though.

bozhidar 2019-05-14T12:25:30.143100Z

I haven’t been able to reproduce it, though.

pez 2019-05-14T12:25:51.143600Z

The history is eaten by the 10K monster.

bozhidar 2019-05-14T12:27:13.145Z

Ah, damn it. My best guess is that the problem happens only with a certain format of the evaluation requests, as no CIDER users have ever reported this.

dominicm 2019-05-14T12:27:17.145100Z

@cichli helped me with this before

dominicm 2019-05-14T12:27:45.146Z

It might be fixed in snapshot piggieback?

bozhidar 2019-05-14T12:27:51.146200Z

He hasn’t been around much lately, but he’s definitely the expert on this part of the code.

pez 2019-05-14T12:28:36.147Z

My theory has been that it is provoked by something that happens before the evaluation request.

bozhidar 2019-05-14T12:29:12.147700Z

One thing that comes to mind is that CIDER uses streamed values by default. I wonder if the problem happens only without them.

bozhidar 2019-05-14T12:29:20.147900Z

> It might be fixed in snapshot piggieback?

bozhidar 2019-05-14T12:29:55.148800Z

Good idea. @cichli did some refactorings there, although I don’t think anything related to bug reports.

pez 2019-05-14T12:30:43.149600Z

I shall see if it is still easy to get this with Calva, if so I can also check wether snapshot fixes it.

markwoodhall 2019-05-14T12:36:59.151Z

I am hitting the problem consistently, I have just tried with piggieback 0.4.1-SNAPSHOT and the issue went away. Will keep trying and see how I get on.

🤘 1
markwoodhall 2019-05-14T12:46:54.152200Z

I did look at the diff between 0.4.0 and 0.4.1-SNAPSHOT and it looked like nothing there could resolve it, it looks like it has though.

bozhidar 2019-05-14T12:53:33.153600Z

@markwoodhall That’s an unexpected, but welcome development. I can cut a release for 0.4.1 is a day or two. Let’s just make sure that the problem goes away for good.

bozhidar 2019-05-14T12:54:45.153900Z

Ah, I’m pretty sure that’s the bug fix https://github.com/nrepl/piggieback/commit/f43e12c13725e2bd31b944d39a55b38dd6b5587c

👍 2
bozhidar 2019-05-14T13:00:45.154900Z

In light of this revelation I’ve just released 0.4.1 right away. I’m just sorry poor @pez wasted a ton of time debugging this, before @dominicm saved us.

pez 2019-05-14T13:03:43.157Z

Haha, I learnt a lot in the process, shed no tears my way. ❤️

👌 1