Emacs Cider startup problems: Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos

Hi all. I’m trying to get familiar with Emacs for Clojure development, and I’m running into some trouble starting cider.

On cider-jack-in, after an impressively long time of waiting for something to happen, I get a long stack trace with the interesting message “Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-apropos in this context”.

I first got that with a deps.edn project, and I read somewhere that changing the clj to clojure would solve that problem. So I did, and it did.

But now I’m in a lein project, and I don’t know how to fix it.

I did find a discussion on Github about this, but it wasn’t clear what the solution is (other than updating Cider… but I think I’m on the latest version).

Suggestions?

I made two changes at once, so I can’t say with certainty which (or if the combination) fixed it.

  1. switched from melpa stable to melpa
  2. updated all packages in Emacs

Regarding #2, I would have assumed that with a fresh install, the packages Emacs would have downloaded would have been the current ones.

In any case, the problem is now gone.