Fork me on GitHub
#cider
<
2019-10-31
>
Lucas Barbosa12:10:35

Any clues on why clj -R:cider -m nrepl.cmdline -i --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]' works while clj -A:cider doesn't? It fails with this message:

Execution error at nrepl.cmdline/parse-cli-values$fn (cmdline.clj:248).
EOF while reading

Full report at:
/var/folders/hw/rwwwsw714zzfn6kq8p8m7p280000gn/T/clojure-9168802566467764242.edn
My deps.edn:
{:paths ["src"]
 :deps  {org.clojure/clojure    {:mvn/version "1.10.1"}
         org.clojure/core.async {:mvn/version "0.4.500"}
         com.wsscode/pathom     {:mvn/version "2.2.26"}}

 :aliases
 {:cider {:extra-deps {cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}
                       refactor-nrepl    {:mvn/version "2.5.0-SNAPSHOT"}
                       nrepl             {:mvn/version "0.6.0"}}
          :main-opts  ["-m" "nrepl.cmdline"
                       "-i"
                       "--middleware" "[\"refactor-nrepl.middleware/wrap-refactor\", \"cider.nrepl/cider-middleware\"]"]}}}

Lucas Barbosa12:10:48

The full report:

{:clojure.main/message
 "Execution error at nrepl.cmdline/parse-cli-values$fn (cmdline.clj:248).\nEOF while reading\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.RuntimeException,
  :clojure.error/line 248,
  :clojure.error/cause "EOF while reading",
  :clojure.error/symbol nrepl.cmdline/parse-cli-values$fn,
  :clojure.error/source "cmdline.clj",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.lang.RuntimeException,
    :message "EOF while reading",
    :at [clojure.lang.Util runtimeException "Util.java" 221]}],
  :trace
  [[clojure.lang.Util runtimeException "Util.java" 221]
   [clojure.lang.EdnReader readDelimitedList "EdnReader.java" 746]
   [clojure.lang.EdnReader$VectorReader invoke "EdnReader.java" 672]
   [clojure.lang.EdnReader read "EdnReader.java" 145]
   [clojure.lang.EdnReader read "EdnReader.java" 111]
   [clojure.lang.EdnReader readString "EdnReader.java" 67]
   [clojure.edn$read_string invokeStatic "edn.clj" 46]
   [clojure.edn$read_string invokeStatic "edn.clj" 37]
   [clojure.edn$read_string invoke "edn.clj" 37]
   [nrepl.cmdline$parse_cli_values$fn__1266 invoke "cmdline.clj" 248]
   [clojure.lang.PersistentArrayMap
    kvreduce
    "PersistentArrayMap.java"
    377]
   [clojure.core$fn__8437 invokeStatic "core.clj" 6845]
   [clojure.core$fn__8437 invoke "core.clj" 6830]
   [clojure.core.protocols$fn__8167$G__8162__8176
    invoke
    "protocols.clj"
    175]
   [clojure.core$reduce_kv invokeStatic "core.clj" 6856]
   [clojure.core$reduce_kv invoke "core.clj" 6847]
   [nrepl.cmdline$parse_cli_values invokeStatic "cmdline.clj" 246]
   [nrepl.cmdline$parse_cli_values invoke "cmdline.clj" 242]
   [nrepl.cmdline$args__GT_cli_options invokeStatic "cmdline.clj" 261]
   [nrepl.cmdline$args__GT_cli_options invoke "cmdline.clj" 253]
   [nrepl.cmdline$_main invokeStatic "cmdline.clj" 447]
   [nrepl.cmdline$_main doInvoke "cmdline.clj" 443]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.core$apply invokeStatic "core.clj" 665]
   [clojure.main$main_opt invokeStatic "main.clj" 514]
   [clojure.main$main_opt invoke "main.clj" 510]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "EOF while reading"}}

dominicm12:10:43

Use a , instead of a space in your deps.edn

Lucas Barbosa12:10:58

@dominicm that shouldn't be the issue, since it uses clojure.edn/read-string to read the vector and , are optional :thinking_face: But anyways, I tried and got the same error šŸ™ https://github.com/nrepl/nrepl/blob/master/src/clojure/nrepl/cmdline.clj#L244

dominicm12:10:35

It doesn't do positional parameters properly though, there's limitations because reasons

Lucas Barbosa12:10:07

Ok, I didn't try replacing the space with a comma, but inserting the comma between the first symbol and the space facepalm removing the space makes it work! Thanks a lot @dominicm

dominicm12:10:51

Sorry. I wasn't very clear. Mobile typing isn't amenable to this sort of thing unfortunately.

Lucas Barbosa12:10:17

No problems! Thanks for the help, I spent like 30 minutes trying to figure this one out

chrisn15:10:36

IS there a public API document for cider-nrepl? For instance, if I want to build a new client unrelated to any current clients?

chrisn16:10:39

Actually, along those lines, is there a simple web-based cider-nrepl client?

chrisn16:10:56

Ideally one that supports vega.

bozhidar16:10:39

Iā€™m not aware of any web-cased nREPL clients.

m0smith22:10:58

What is the trick to attach to an nRepl running remotely in a docker container. EMACS thinks it is talking to it but cider gets lost somehow. The last of the nrepl-tunnel logs looks happy: