clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.55k stars 645 forks source link

Can't run standalone repl with leiningen 2.8.3 #2596

Closed lverns closed 5 years ago

lverns commented 5 years ago

I'm unable to spin up a standlone repl to connect to with Leiningen 2.8.3, but can with 2.9.0. Since latest lein + latest cider work together, I don't know that we'll care about making code changes. If not, we should probably update the docs to recommend 2.9.0 or newer.

https://docs.cider.mx/en/latest/installation/#setting-up-a-standalone-repl

Expected behavior

Running lein repl starts up a REPl that I can connect to with cider-connect in Emacs.

Actual behavior

Running lein repl in a fresh Leiningen project (or in no project), produces the stacktrace in the reproduction section.

Steps to reproduce the problem

$ lein new test-app
Generating a project called test-app based on the 'default' template.
The default template is intended for library projects, not applications.
To see other templates (app, plugin, etc), try `lein help new`.
$ cd test-app
$ lein repl
Warning: implicit middleware found: cider-nrepl.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.io.FileNotFoundException: Could not locate nrepl/middleware/caught__init.class or nrepl/middleware/caught.clj on classpath., compiling:(cider/nrepl.clj:1:1)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context, compiling:(/tmp/form-init6414495256683844597.clj:1:8466)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7010)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)
    at clojure.lang.Compiler.analyze(Compiler.java:6729)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7005)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)
    at clojure.lang.Compiler.analyze(Compiler.java:6729)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7005)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)
    at clojure.lang.Compiler.access$300(Compiler.java:38)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6368)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)
    at clojure.lang.Compiler.analyze(Compiler.java:6729)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6100)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5460)
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4022)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7001)
    at clojure.lang.Compiler.analyze(Compiler.java:6773)
    at clojure.lang.Compiler.eval(Compiler.java:7059)
    at clojure.lang.Compiler.eval(Compiler.java:7052)
    at clojure.lang.Compiler.eval(Compiler.java:7052)
    at clojure.lang.Compiler.load(Compiler.java:7514)
    at clojure.lang.Compiler.loadFile(Compiler.java:7452)
    at clojure.main$load_script.invokeStatic(main.clj:278)
    at clojure.main$init_opt.invokeStatic(main.clj:280)
    at clojure.main$init_opt.invoke(main.clj:280)
    at clojure.main$initialize.invokeStatic(main.clj:311)
    at clojure.main$null_opt.invokeStatic(main.clj:345)
    at clojure.main$null_opt.invoke(main.clj:342)
    at clojure.main$main.invokeStatic(main.clj:424)
    at clojure.main$main.doInvoke(main.clj:387)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.lang.Var.applyTo(Var.java:702)
    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:7003)
    ... 35 more

Environment & Version information

CIDER version information

$ cat ~/.lein/profiles.clj 
{:repl {:plugins [[cider/cider-nrepl "0.21.1"]]}}

This also happens with 0.21.0, but not 0.20.0.

Lein/Boot version

Leiningen 2.8.3 on Java 1.8.0_162 Java HotSpot(TM) 64-Bit Server VM

Using version 2.9.0 solves the problem.

Emacs version

N/A - Failure happens before emacs is relevant.

Operating system

Fedora release 28 (Twenty Eight)

dpsutton commented 5 years ago

Can you try this with lein 2.9.0? I believe you need nrepl 0.6.0 with CIDER 21 and above and lein 2.8.3 comes with cider 0.5.5 or 0.5.0. Should be as simple as lein upgrade 2.9.0

lverns commented 5 years ago

@dpsutton To quote myself (emphasis added):

I'm unable to spin up a standlone repl to connect to with Leiningen 2.8.3, but can with 2.9.0. Since latest lein + latest cider work together, I don't know that we'll care about making code changes. If not, we should probably update the docs to recommend 2.9.0 or newer.

https://docs.cider.mx/en/latest/installation/#setting-up-a-standalone-repl

bbatsov commented 5 years ago

Yeah, now 2.9.0 is required if you’re using cider-connect (Or you should override the nREPL dep in your Lein profiles). That’s an oversight on our part.