This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-23
Channels
- # announcements (2)
- # beginners (82)
- # calva (13)
- # cider (12)
- # clara (4)
- # cljdoc (22)
- # clojure (89)
- # clojure-dev (23)
- # clojure-europe (16)
- # clojure-italy (39)
- # clojure-nl (8)
- # clojure-spec (28)
- # clojure-uk (36)
- # clojurescript (40)
- # cursive (10)
- # data-science (1)
- # datomic (27)
- # devcards (4)
- # emacs (1)
- # fulcro (25)
- # jobs (1)
- # jobs-discuss (3)
- # kaocha (5)
- # luminus (1)
- # nrepl (68)
- # off-topic (64)
- # pedestal (23)
- # planck (1)
- # quil (4)
- # re-frame (6)
- # reitit (5)
- # remote-jobs (4)
- # shadow-cljs (16)
- # spacemacs (11)
- # testing (1)
Can anyone see the reason why this project file:
(defproject pftv "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url " "}
:dependencies [[org.clojure/clojure "1.9.0"]
[criterium "0.4.4"]]
:repl-options {:init-ns pftv.core})
With this command line: lein update-in :dependencies conj "[nrepl \"0.5.3\"]" -- update-in :plugins conj "[cider/cider-nrepl \"0.20.0\"]" -- update-in "[:repl-options :nrepl-middleware]" conj "[\"cider.nrepl/cider-middleware\"]" -- repl
Would fail like this: Error loading cider.nrepl: Syntax error compiling at (cider/nrepl.clj:1:1).
...
Exception in thread "main" Syntax error compiling var at (/private/var/folders/cs/v0sbd67j3_s93nx488j890bw0000gn/T/form-init7118680432847839889.clj:1:9206).
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7114)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3888)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7108)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.access$300(Compiler.java:38)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.analyze(Compiler.java:6745)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7104)
at clojure.lang.Compiler.analyze(Compiler.java:6789)
at clojure.lang.Compiler.eval(Compiler.java:7173)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7635)
at clojure.lang.Compiler.loadFile(Compiler.java:7573)
at clojure.main$load_script.invokeStatic(main.clj:452)
at clojure.main$init_opt.invokeStatic(main.clj:454)
at clojure.main$init_opt.invoke(main.clj:454)
at clojure.main$initialize.invokeStatic(main.clj:485)
at clojure.main$null_opt.invokeStatic(main.clj:519)
at clojure.main$null_opt.invoke(main.clj:516)
at clojure.main$main.invokeStatic(main.clj:598)
at clojure.main$main.doInvoke(main.clj:561)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:7106)
... 36 more
The background here is that I am tryin gto figure out the right jack-in command lines for Calva 2. And using nrepl 0.6.0 , cider-nrepl 0.21.1 and piggieback 0.4.0 behaves sufficiently different for the cljs repl that I would like to try use the generation before. That works nicely in my cljs test project, but then I tried with a simple clj-only project and got the above.
I get a lot of Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/pr_values__init.class or nrepl/middleware/pr_values.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name., compiling:(cider/nrepl.clj:1:1)
on clojure 1.8.0
If I remove the clojure dependency I get
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
Subprocess failed
I can go even simpler than your example though lein update-in :plugins conj "[cider/cider-nrepl \"0.20.0\"]" -- repl
doesn't work, lein update-in :plugins conj "[cider/cider-nrepl \"0.21.0\"]" -- repl
does
And if I also remove the criterium dependency the repl starts, but before that a lot of complaints and of course my code needing criterium will not work.
You mean trying with emacs/cider? No, haven’t. I will do that now. Thing is my computer does not really like emacs, which is why Calva even exists. But I will force feed it.
(defproject pftv "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.8.0"]]
:plugins [[cider/cider-nrepl "0.20.0"]])
with lein repl
is broken❯ lein deps :tree
[cider/cider-nrepl "0.20.0"]
[cider/orchard "0.4.0" :exclusions [[org.clojure/clojure]]]
[org.tcrawley/dynapath "0.2.5" :exclusions [[org.clojure/clojure]]]
[cljfmt "0.6.1" :exclusions [[org.clojure/clojure] [org.clojure/clojurescript]]]
[com.googlecode.java-diff-utils/diffutils "1.3.0"]
[org.clojure/tools.cli "0.3.7"]
[rewrite-clj "0.6.0"]
[rewrite-cljs "0.4.4"]
[cljs-tooling "0.3.1" :exclusions [[org.clojure/clojure]]]
[compliment "0.3.8" :exclusions [[org.clojure/clojure]]]
[fipp "0.6.14" :exclusions [[org.clojure/clojure]]]
[org.clojure/core.rrb-vector "0.0.13"]
[mvxcvi/puget "1.0.2" :exclusions [[org.clojure/clojure]]]
[mvxcvi/arrangement "1.1.1"]
[org.clojure/java.classpath "0.3.0" :exclusions [[org.clojure/clojure]]]
[org.clojure/tools.namespace "0.3.0-alpha4" :exclusions [[org.clojure/clojure]]]
[org.clojure/tools.reader "1.2.2" :exclusions [[org.clojure/clojure]]]
[org.clojure/tools.trace "0.7.10" :exclusions [[org.clojure/clojure]]]
[thunknyc/profile "0.5.2" :exclusions [[org.clojure/clojure]]]
[clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
[nrepl "0.6.0" :exclusions [[org.clojure/clojure]]]
[org.clojure/clojure "1.8.0"]
Looks good to me, modern nrepl versionWeird, without cider I'm getting:
❯ lein repl
nREPL server started on port 42939 on host 127.0.0.1 -
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.8.0
OpenJDK 64-Bit Server VM 1.8.0_202-b00
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (require 'nrepl.middleware.pr-values)
(defproject pftv "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.8.0"]
[nrepl "0.5.3"]]
:plugins [[cider/cider-nrepl "0.20.0"]])
This works fine(of course, your injecting that via cli should work too, but it's not for some reasons, but now we know what is wrong)
I have a suspicion that leiningen doesn't allow injecting the nrepl version via update-in
easily verified:
/tmp/foo 1 21:09:49
❯ lein update-in :dependencies conj "[nrepl \"0.5.3\"]" -- deps :treePossibly confusing dependencies found:
[nrepl "0.6.0" :exclusions [org.clojure/clojure]]
overrides
[nrepl "0.5.3"]
Consider using these exclusions:
[clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
[nrepl "0.6.0" :exclusions [[org.clojure/clojure]]]
[org.clojure/clojure "1.8.0"]
OK. I would have hoped that things moved in the direction where no project includes nrepl etc , and instead the world would depend on injections.
Yeah, it makes some sense, of course, but … Anyway, this leaves me with the only option to try figure out why Calva does not work with piggieback 0.4.0 (not sure it is piggieback that is the culprit, but the hints I have gathered so far points in that direction.
So, this might be the best place to ask this. With piggieback 0.4.0 (again, I think it’s piggieback) I do not get any out
or err
result messages from my eval
calls for the cljs repl. Am I supposed to look for them in some other way?
(-->
id "310"
op "eval"
session "65a5a0ee-d1f8-4fb4-ac1d-fac1df6e19c8"
time-stamp "2019-04-23 15:28:51.837145000"
code "(prn (+ 1 1))
"
column 1
file "/Users/dan/projects/aclaimant/acl/resources/public/js/app.ou..."
line 56
nrepl.middleware.print/print "cider.nrepl.pprint/pr"
nrepl.middleware.print/quota 1048576
nrepl.middleware.print/stream? nil
ns "pushy.core"
)
(<--
id "11"
session "65a5a0ee-d1f8-4fb4-ac1d-fac1df6e19c8"
time-stamp "2019-04-23 15:28:51.876571000"
out "2
"
)
(<--
id "310"
session "65a5a0ee-d1f8-4fb4-ac1d-fac1df6e19c8"
time-stamp "2019-04-23 15:28:51.882699000"
ns "pushy.core"
printed-value 1
value "nil"
)
(<--
id "310"
session "65a5a0ee-d1f8-4fb4-ac1d-fac1df6e19c8"
time-stamp "2019-04-23 15:28:51.884496000"
status ("done")
)
Also. I get this in the terminal where I started the REPL with 0.4.0:
Exception in thread "nRepl-session-8067c4a9-e320-4f8e-b84f-890c8cbf2097" 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$eval20664$fn__20665$G__20655__20672.invoke(transport.clj:16)
at nrepl.middleware.print$replying_PrintWriter$fn__21121.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:802)
at cljs.repl$repl_caught.invoke(repl.cljc:788)
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__21926$fn__21929$fn__21930.invoke(piggieback.clj:305)
at cider.piggieback$enqueue$fn__21898.invoke(piggieback.clj:195)
at clojure.lang.AFn.run(AFn.java:22)
at nrepl.middleware.session$session_exec$main_loop__21356$fn__21360.invoke(session.clj:171)
at nrepl.middleware.session$session_exec$main_loop__21356.invoke(session.clj:170)
at clojure.lang.AFn.run(AFn.java:22)
at java.lang.Thread.run(Thread.java:748)
I think Calva users can live it for a while. But right now that error thrown kills my cljs repl client. I should of course try to make it handle that more gracefully…
I think I might want to get at the info in the out-subscribe, btw. Lots of users ask about where output from their apps go, and that would be a way to present it, right?