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.
@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
.
Does the shadow-cljs project use a Leiningen http://project.cl
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.
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.
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.
I am reading through the shadow-cljs docs to see if I can understand what is happening
This seems relevant, just reading it now https://shadow-cljs.github.io/docs/UsersGuide.html#user-config
SPC b m
seems to kill all buffers
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
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"]]}
since i’m using deps.edn
along with shadow, I think I need to specify it there. but I’ll try both ways
ah
that’s a global config
i do see the wrong version specific there, that must be it! thanks
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).
I havent tried shadow-cljs yet, so let me know if you get it working. I will give it a try one day soon 🙂
trying it now, will report back!
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.
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`
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.ednwill play around with it to see what works but at least now i’m seeing a different warning 😅
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