Fork me on GitHub
#emacs
<
2019-12-08
>
luizmineo18:12:23

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

luizmineo18:12:54

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

luizmineo18:12:30

but the repl complains that nrepl-refactor is missing

luizmineo18:12:32

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

luizmineo18:12:12

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

dotemacs20:12:43

@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…

luizmineo23:12:22

@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