Fork me on GitHub

Hi, can I use clj-refactor with shadow-cljs projects?


I'm trying to enable it in a project created with the default re-frame template


but the repl complains that nrepl-refactor is missing


WARNING: clj-refactor and refactor-nrepl are out of sync. Their versions are 2.5.0-SNAPSHOT (package: 20190618.716) and n/a, respectively.


Already tried to add it as a dependency, on both project.clj and shadow-cljs.edn


@UREHT6UJC From the error message it seems that they are not the compatible with each other. Try to install the latest stable versions. Looking at the repo for clj-refactor the latest is at 2.4.0 so try to install that version. I’m guessing that in your emacs config you’ve declared the MELPA repo somewhere. If that is the case, try to declare and use MELPA stable . This is just a guess, since I don’t know how you’ve configured your emacs…


@U3SG7RX7A Thanks for the hints. I was able to solve this issue by configuring the refactor-nrepl middleware in shadow-cljs.edn

:nrepl {:port 8777
         :middleware [refactor-nrepl.middleware/wrap-refactor]}
Also, I removed the clj-refactor and refactor-nrepl dependencies from project.clj. It seems that cider can inject the correct versions when repl starts, we just have to manually configuring the middleware in shadow-cljs

👍 4