Fork me on GitHub

hey all. I’m using spacemacs and my refactoring doesn’t appear to work. I can’t rename symbols. It tries to analyze the project and then comes back with an error in the minibuffer I don’t manage to read.


I’m on OS X… does anyone know whats up?


@triss some version information will be useful. What’s your CIDER, cider-nrepl and refactor-nrepl.

👍 1

;; CIDER 0.17.0snapshot (package: 20180207.2103), nREPL 0.2.13…


just double checking I have refactor-nrepl maybe thats the missing piece!


maybe my refactor nrepl is a bit old


Ok I just updated to refactor-nrepl latest version


still the same issue.


What’s the error you’re getting?


I can’t see - just abig stack trace that flashes by in the mini-buffer


It asks me if I want to analyze the project


It sasy Fetching symbol occurences just before bombing out


oh sorry I jut found it in Messages


I think it’s an issue with some of my namespaces… sorry for all the noise. just finding my way in to CIDER properly…


I've trying to get CIDER running in a lein based project after upgrading emacs and CIDER. The currently installed CIDER package version is 20180813.1518. In the project.clj I removed all references to org.clojure/tools.nrepl (and com.cemerick/piggieback) because my understanding based on is CIDER will inject the new moved versions automatically. Please note that nrepl/drawbridge "0.1.3" also is a project dependency. As a first step, I would like to get the JVM Clojure repl running again. Once that works I'll tackle the (figwheel) cljs repl. When I run cider-jack-in-clj, Clojure fails to start and in *Messages* I find

Caused by: java.lang.ClassNotFoundException:
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(
	at java.base/java.lang.ClassLoader.loadClass(
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(
	at clojure.lang.RT.classForName(
	at clojure.lang.RT.classForName(
	at cheshire.factory__init.__init0(Unknown Source)
	at cheshire.factory__init.<clinit>(Unknown Source)
	... 233 more
Note: com.fasterxml.jackson.core/jackson-core is not explicitly referenced or excluded in the project.clj). This project was up and running 2 weeks ago the last time with the old version of emacs and CIDER. Can someone hold my hand and help me get up and running again? Is more of the stacktrace useful?


@vinai Is this from drawbridge?


I’ve never even heard of this XML library.


I think auth.buddy uses it


Maybe it's easier to start from the unmodified project.clj.


Okay, I reset the project so it contains the old drawbridge and nrepl dependencies and run cider-jack-in-clj and it comes up!


Now, I'll try replacing nrepl and drawbridge with the new versions again.


wondering if anyone can help with me fix this error. I'm using emacs 26.1, and cider from MELPA (`0.18snapshot`). I like to use a stand-alone repl, and have followed the cider manual's troubleshooting section , but not having any luck. I have the same version specified in the :repl the lein profiles.clj (`0.18.0-SNAPSHOT`) as I'm using in emacs. I'm using Leiningen 2.8.1 on Java 1.8.0_171 OpenJDK 64-Bit Server VM. The error I'm getting when running cider-connect is:

Debugger entered--Lisp error: (error "Version must be a string")
  signal(error ("Version must be a string"))
  error("Version must be a string")
  version<=("0.18.0" nil)
  nrepl-start-client-process("localhost" 36225 nil #f(compiled-function (_) #<bytecode 0x29233bd>))
  cider-nrepl-connect((:project-dir "~/git/wormbase-names/" :host "localhost" :port 36225 :repl-init-function nil :session-name nil :repl-type "clj"))
  funcall-interactively(cider-connect-clj nil)
  call-interactively(cider-connect-clj nil nil)
I'm using lein, here the profiles.clj I'm using: My emacs cider setup: cider-jack-in works for me, so I assume I've missed something simple, but can't see what after a couple of hours staring at this.


Should I remove the explicit dependency on [org.clojure/tools.nrepl "0.2.13"] or should I replace it with nrepl "0.4.4"?


Just removing the references to the old tools.nrepl seems to work. Next, I'll try to replace drawbridge. 1. Dependency changed [com.cemerick/drawbridge "0.0.7"] to [nrepl/drawbridge "0.1.3"] 2. Require changed [cemerick.drawbridge :as drawbridge] to [drawbridge.core :as drawbridge] Aaand it seems like that worked, too. So it looks like before I was taking a too large step at once. Sorry for wasting your time.


Now I'll try cider-jack-in-cljs with ClojureScript REPL type figwheel with the old piggieback in the project.clj. That works. I'll try to move piggieback now: In the :dev profile I replace [com.cemerick/piggieback "0.2.2"] with [cider/piggieback "0.3.8"] And in :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]} I replace it with cider.piggieback/wrap-cljs-repl. Now when running cider-jack-in-cljs with REPL type figwheel I get the error

!!! Unable to load a ClojureScript nREPL middleware library
Exception Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback.
This is commonly caused by
 A) not providing piggieback as a dependency and/or
 B) not adding piggieback middleware into your nrepl middleware chain.

example profile.clj code:
:profiles {:dev {:dependencies [[com.cemerick/piggieback <current-version>]
                                [org.clojure/tools.nrepl  <current-version>]]
                 :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}}
Please see the documentation for piggieback here 
I'm confused that the error is still referencing the old piggieback and nrepl locations.


It seems I'm running CIDER 0.18.0snapshot (package: 20180813.1518) with the old nREPL 0.2.13. I thought they where incompatible?


@vinai you probably need a newer version of figwheel-sidecar


Currently using 0.5.15, will check


0.5.16 is what you need


that's when I changed it so that it could work with cider/piggieback


I guess I should use figwheel 0.5.16, too?


And yes, that worked! Thank you!!

Mario C.15:08:08

I keep getting could not locate ring/server/standalone__init.class on classpath. I have no idea how to fix this issue.

Mario C.15:08:39

Would running Cider with with-profiles fix this issue?


sounds like it. You can set cider-lein-parameters to "with-profile +profile1 +profile2 repl :headless via customize-variable, in your .emacs/init.el or .dir-locals


for example.

Mario C.16:08:04

Is that all in double quotes when I prompted with Set cider-lein-parameters globally to value:


if you're setting it via customize-variable, then no quotes required around it I don't think.

Mario C.16:08:46

I am running the commands. 1. SPC SPC 2. set-variable 3. cider-lein-parameters

Mario C.16:08:57

The I get that prompt from above

Mario C.16:08:03

It seems like I do need the quotes

Mario C.16:08:56

@mgrbyte Thanks! So basically it was with-profile profile1, profile2 repl :headless

Mario C.16:08:06

The comma was needed


doh, of course, sorry

Mario C.15:08:59

I have two profiles I normally use to run the project.

Mario C.16:08:04

Feels so good having a REPL now 😅

Mario C.16:08:26

Not having it was the bane of my spacemacs experience


@mgrbyte Your profiles setup seems correct, but the error you got indicates that cider-nrepl is not loaded at all.


Therefore the nil version.


You were right! 🙂


I'm using deps.edn (via lein-tools-deps), and it seems it's not merging the lein profile


I added cider-nrepl to the :extra-deps of my :dev alias, and now it connects


Although now I get:

WARNING: CIDER 0.18.0-snapshot requires cider-nrepl to work normally. Please, install it!
         More information.
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 2.4.0-SNAPSHOT (package: 20180808.606) and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.


So am guessing a similar issue :thinking_face:


Noticed that in the cider manual it mentions that it's a common mistake to put cider-nrepl in :plugins instead of :dependencies in the :repl profile - think a reason for this might be that refactor-nrepl has that on it's github README.


I misread.


FWIW, I have successfully resolved my issue (using 0.18.0-SNAPSHOT) - working from both cider-connect and cider-jack-in-clj. The trick was to remove the configuration in ~/.lein/profiles.clj and move it to my :dev profile in project.clj. Something not quite right, but probably because I'm using tools-deps and lein and latest snapshot. Something not quite right with profile merging when tools-deps in place. TBH I've always experienced issues with lein profile merging, something I hope goes away! 😆

🎉 1

where can I find how to add metadata to Clojure for formatting?


ok found, but I have a problem, I have a macro like let and I am using {:style/indent 1} like clojure-mode...but I do not get the body forms aligned right


@vinai could you post your project.clj that has a final working version of all the new cider settings. would be very useful to see it all in one place 🙂


@fenton sure, it's rather big, but if it helps...


cider-jack-in-cljs seems to create a clojure not clojurescript repl...


@vinai i think i gleaned what was required... , but not sure i've got a cljs repl in the end....


This works now with clj + cljs figwheel repl


@vinai what function are you running to get a cljs repl?


cider-jack-in-cljs or cider-jack-in-clj&cljs


oh darn I'm getting the slow down in cljc files again


@vinai thx I'll try to compare with what I've got as ...&cljs isn't bringing up a cljs repl 🙂