Fork me on GitHub
#spacemacs
<
2020-03-07
>
Aleed19:03:22

I just setup spacemacs (used @jr0cket guide/setup, thanks btw!) and I’m trying to get cider repl working with shadow-cljs. I confirmed it works with a basic clj project, but can’t seem to get code evaluated with shadow. Is there extra configuration or steps required for this? I do this this warning in repl* console: WARNING: CIDER 0.25.0-snapshot requires 'cider-nrepl 0.25.0-SNAPSHOT, but you're currently using cider-nrepl 0.21.1. The version mismatch might break some functionality! So that might be the cause. But not sure where the cider repl version is specified, I don’t see it in spacemacs init.el file and specifing a specifc version in my projects deps.edn does not seem to change anything.

practicalli-johnny20:03:08

@alidcastano it depends how you are starting the REPL. If you start the REPL outside of Spacemacs, via some shadow-clj command and then using cider-connect from Spacemacs, then there may be a an older version of cider-nrepl somewhere in the shadow-clj project. If you are using cider-jack-in-cljs or cider-jack-in-clj&cljs then it would be very strange to get this error, unless there is something in the shadow-cljs again adding an eariler version of cider-nrepl .

practicalli-johnny20:03:31

Does the shadow-cljs project use a Leiningen http://project.cl

Aleed20:03:31

it uses a deps.edn configuration I’ve tried both ways: cider-jack-in and cider-connect, can’t seem to get it working in either case and in both situations see that warning in the repl console.

practicalli-johnny20:03:58

if you look in the SPC b m message buffer it should show you the full command that is used to start the REPL from Emacs. Or you can use SPC u before jack-in or connect to check / edit the command used.

Aleed20:03:02

SPC b m seems to kill all buffers

practicalli-johnny20:03:06

It sounds like the shadow-cljs project has an earlier version of cider-nrepl, which I assume it uses to start an nREPL server so that an editor, such as Emacs/Spacemacs/Cider can connect to.

practicalli-johnny20:03:29

I am reading through the shadow-cljs docs to see if I can understand what is happening

Aleed20:03:57

thanks for link, and for looking into it. I did try explicitly specifying a cider-repl version but perhaps I didn’t do it right. will try again

practicalli-johnny20:03:09

Yes, edit the ~/.shadow-cljs/config.edn which I assume is the main config that shadow creates across all your projects. It should have been created the first time you ran shadow-cljs. Put a newer dependency in there

{:dependencies
 [[cider/cider-nrepl "0.25.0-SNAPSHOT"]]}

Aleed20:03:44

since i’m using deps.edn along with shadow, I think I need to specify it there. but I’ll try both ways

Aleed20:03:30

that’s a global config

Aleed20:03:39

i do see the wrong version specific there, that must be it! thanks

practicalli-johnny20:03:35

if you still get a warning, then you could also check ~/.nrepl/nrepl.edn or in the .nrepl.edn file inside the project (I guess at the root of the project).

practicalli-johnny20:03:06

I havent tried shadow-cljs yet, so let me know if you get it working. I will give it a try one day soon 🙂

Aleed20:03:43

trying it now, will report back!

Aleed21:03:24

so i’m now seeing `clj-refactor and refactor-nrepl are out of sync. Their versions are 2.5.0 (package: <tel:202002291105|20200229.1105>) and n/a`

Aleed21:03:30

i also see this in buffer that starts the repl

WARNING: The configured :dependencies in shadow-cljs.edn were ignored!
         When using :deps they must be configured in deps.edn
so not sure if global shadow config is used, i think maybe its n/a now because i removed cider from my deps.edn

Aleed21:03:49

will play around with it to see what works but at least now i’m seeing a different warning 😅

practicalli-johnny20:03:52

You should just be able to cider-jack-in-clj&cljs and evaluate code from within Spacemacs. However, I dont think you are supposed to run the shadow-cljs server if you do jack-in from Emacs, it should run the shadow-cljs server for you.

Aleed21:03:13

yes, when i jack-in i do see the shadow-cljs server running - it’s just doesn’t seem to be evaluating the code, which is why I’m trying to fix the version mismatch warning I see in repl console