clojure-emacs / cider-nrepl

A collection of nREPL middleware to enhance Clojure editors with common functionality like definition lookup, code completion, etc.
https://docs.cider.mx/cider-nrepl
676 stars 176 forks source link

Can't jack-in with [nrepl "0.6.0"] #608

Closed 0atman closed 5 years ago

0atman commented 5 years ago

Cider crashes when I try to jack-in with [nrepl "0.6.0"] in my project.clj

Expected behavior

Jacks in successfully, as happens in a project with the older [org.clojure/tools.nrepl "0.2.13"]

Actual behavior

Crashes cider, error is java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context

Full exception from **messages**:

error in process sentinel: Could not start nREPL server: Warning: implicit middleware found: refactor-nrepl.plugin/middleware 
Please declare all middleware in :middleware as implicit loading is deprecated.
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/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/middleware/pprint.clj:7:1)
Error loading cider.nrepl: java.lang.Exception: namespace ’cider.nrepl.middleware.pprint’ not found, compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.lang.Exception: namespace ’cider.nrepl.middleware.pprint’ not found, compiling:(cider/nrepl.clj:1:1)
[...]
Error loading cider.nrepl: java.lang.Exception: namespace ’cider.nrepl.middleware.pprint’ not found, compiling:(cider/nrepl.clj:1:1)
Error loading cider.nrepl: java.lang.Exception: namespace ’cider.nrepl.middleware.pprint’ not found, 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-init3044133547390025432.clj:1:7848)
    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.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)
    ... 34 more
Subprocess failed

Steps to reproduce the problem

, ' in spacemacs in a project that has [nrepl "0.6.0"] in the dependencies

BONUS: Steps to fix the problem

commenting out the nrepl dependency in my project.clj fixes it. #_[nrepl "0.6.0"]

Environment & Version information

cider-nrepl version

update-in :dependencies conj [nrepl "0.5.0"] --
update-in :plugins conj [refactor-nrepl "2.4.0"] --
update-in :plugins conj [cider/cider-nrepl "0.19.0-SNAPSHOT"]

emacs version

emacsclient 25.2

spacemacs version

12defb470e9eb6b19c6576045864a4187fc01317, which is the head of today's develop

Java version

openjdk version "1.8.0_191"

Operating system

Ubuntu 18.04 LTS

0atman commented 5 years ago

Thanks in advance for your help, cider ROCKS!

bbatsov commented 5 years ago

You need to use Lein 2.9 and CIDER 0.21. Seems to me currently you are using Lein 2.8.

On Fri, 12 Apr 2019 at 16:15, Tristram Oaten notifications@github.com wrote:

Thanks in advance for your help, cider ROCKS!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/clojure-emacs/cider-nrepl/issues/608#issuecomment-482590838, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGVyswxaqTD8B5kwVmWVSwwkjxZ8kpYks5vgJUWgaJpZM4csN3m .

0atman commented 5 years ago

Thank you @bbatsov, you're quite right about the old version of lein - but how do I upgrade CIDER, is that something I have to wait for the spacemacs layer to update? I presume we're talkinag about cider/cider-nrepl "0.19.0-SNAPSHOT".

0atman commented 5 years ago

Wait, I figured it out. Seems I've NEVER updated any of my spacemacs packages before :laughing:

0atman commented 5 years ago

That was it, thanks man :+1:

lrustand commented 8 months ago

No matter what I do I can't get cider to work. One of the errors I keep getting is the one posted above. My cider is up-to-date, in fact I just installed it today.

vemv commented 8 months ago

Hi @lrustand, please create your issue from scratch, in detail - any match with past stacktraces is purely coincidental.

Thanks - V