cider-nrepl's version is nil. Any ideas on how to fix?

48 views
Skip to first unread message

Leonel Gayard

unread,
Jun 11, 2018, 4:32:21 PM6/11/18
to Luminus
Hi,

This is on a fresh project generated from the CLI: lein new luminus myapp +h2

When connecting to the REPL from Emacs with CIDER, I get the error message,

WARNING: CIDER's version (0.17.0) does not match cider-nrepl's version (nil). Things will break!

Also, simple IDE commands, like looking for the documentation of a symbol do not work; Emacs will display a non-formatted exception as below.

Wrong type argument: stringp, nil

There is also a link to the troubleshooting section in the CIDER home page, at [1]. I have followed the instructions there, but the problems described above remain. In particular, adding a Leiningen plugin for cider-nrepl did not solve the problem.

Can any emacs and cider users give me a suggestion?


Thanks,
Leonel

Dmitri

unread,
Jun 11, 2018, 5:47:45 PM6/11/18
to Luminus
I don't use cider myself, but might be the fact that cider middleware is missing. You could try using +cider flag when creating the app that should inject the needed middleware for dev.

Leonel Gayard

unread,
Jun 12, 2018, 8:33:19 AM6/12/18
to Luminus
Solved!

The app generated by the luminus template contains a function repl-server that starts an embedded nrepl-server, but does not use the cider handler.

The (ad-hoc) solution is to:
  1. Include a dependency       [cider/cider-nrepl "0.17.0"] as a plugin
  2. require the namespace cider.nrepl
  3. modify the function repl-server as below
(mount/defstate ^{:on-reload :noop} repl-server
  :start
  (when (env :nrepl-port)
    (repl/start { :bind (env :nrepl-bind)
                  :port (env :nrepl-port)

                  :handler cider.nrepl/cider-nrepl-handler ;; this makes the nrepl server use the cider middleware
                   }))

The drawback of this solution is the dependency on cider-nrepl, which may be a burden in a PRD release.

But that's a start :-)

Regards,
Leonel

WEIDONG XU

unread,
Jan 17, 2019, 7:47:36 AM1/17/19
to Luminus
Even in the occasions other than luminus, it could also be found that cider-nrepl version doesn't match the cider's version, when your cider's version as a package of emacs isn't equal to the cider-nrepl's version as a dependency of your lein project

在 2018年6月12日星期二 UTC+8上午5:47:45,Dmitri写道:
Reply all
Reply to author
Forward
0 new messages