This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
i have an issue with one project i'm working on; when evaluating a certain form, cider just crashes without raising an error. All it prints is *** Closed on Sun Jul 30 11:15:13 2023 ***
. I can execute the namespace with clojure -m …
; any idea how I could figure out what's wrong, or get cider to be a bit more talkative about it?
The *messages*
buffer contains [nREPL] Connection closed unexpectedly (connection broken by remote peer)
I'd recommend to start your JVM/cider-nrepl process in your terminal, and then cider-connect
to it.
That way, if it crashes, you should see a stacktrace or other debug info
Perhaps something in a .dir-locals.el
file (if that file exists in the root of the Clojure project)
Or on a custom user.clj file if added to the path (possibly by the .dir-locals.el)
No, nothing like that. I assumed it's some weird dynamic library issue related to nix / direnv, but I can't find anything in that direction
Its pretty hard to make the connection go bang, so it seems likely that the REPL process is trying to do something that Nix wont let it do... this would be my guess.
do any of the codepaths have any System/exit 0
type forms? Code can make the jvm exit and you see the messages you are seeing
> Hm… it doesn’t happen when I start it in a terminal > No, nothing like that. I assumed it’s some weird dynamic library issue related to nix / direnv, but I can’t find anything in that direction You can check exactly what command jack-in used to start the REPL (either messages or at the start of the repl buffer, I can’t recall), and then manually run that in the terminal (I use nix and direnv, so I know it can work)
That's what I did, I copied the command that's printed at the beginning of the repl section
Oh! Sometimes I have to actively invoke envrc-allow/envrc-reload-all to make cider pick up the right environment (and apparently not from a magit buffer, for whatever reason)!
I use (executable-find "clojure")
(or anything else project-defined) to make sure it matches what I get from a regular terminal session