cider

pieterbreed 2026-05-27T08:11:41.122139Z

Hello team, I'm having a new issue as of this morning's updates. The cider-jack-in command somehow creates a repl environment without the correct classpath. I still get the correct Startup: command in the repl buffer. The repl created from cider-jack-in starts very quickly, whereas the classpath I expect is heavy and it takes a few seconds to open normally. If I copy the Startup command verbatim to a terminal, it works, and I can cider-connect and it creates the classpath correctly. (`clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.7.0\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.59.0\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[cider.nrepl/cider-middleware\]\"\]\}\}\} -M:test:repl:notebooks:cider/nrepl`) To compare, I ran this command in both repls to count the classpath entries: (count (str/split (System/getProperty "java.class.path") (re-pattern (System/getProperty "path.separator")))) For the cider-created repl buffer, this value is 12 If I run the exact same startup in the terminal and count the classpath entries, I get the correct 336. I've got a work-around for now, but thought reporting it here could help somehow.

rolt 2026-05-27T08:22:19.794279Z

Is the repl started in the correct folder ? The change to use project.el messed up my setup too because my setup is a bit weird with regards to projectile

pieterbreed 2026-05-27T08:25:34.453209Z

you are spot on, this is exactly the issue.

pieterbreed 2026-05-27T08:26:09.086639Z

ugh - my clojure project is in a sub-folder of the project, because it's kindof polyglot project

rolt 2026-05-27T08:30:00.710659Z

I still think there is an issue, deps.edn detection should have precedence over .git detection given it's in the cider-build-tool-files list, but for some reason it's not working

👍🏽 1
pieterbreed 2026-05-27T08:34:20.982359Z

Are you aware of a way to customize or override this in something like .dir-locals.el? I might have missed it, but didn't find anything after a quick scan of the docs

rolt 2026-05-27T08:36:59.309959Z

I use projectile so right now I've just created an empty .projectile file at the root of each of my clojure projects until I find the root cause

rolt 2026-05-27T08:37:45.679579Z

without it, maybe a .project file instead ?

pieterbreed 2026-05-27T08:38:07.453799Z

I use projectile too; I'll try it

pieterbreed 2026-05-27T08:40:01.831489Z

had to restart emacs to get rid of the hidden state, but it does work for me. Thank you

narimiran 2026-05-27T10:29:09.794889Z

I had the same problem (Clojure and deps.edn in a subfolder of a project, cider not seeing it), which started recently and, after banging my head for more than an hour, this was the solution that seems to work:

;; To see `deps.edn` inside of a subdirectory
(with-eval-after-load 'projectile
  (add-to-list 'projectile-project-root-files-bottom-up "deps.edn"))

🙏🏽 1
rolt 2026-05-27T15:39:40.625689Z

(setq projectile-project-root-files-bottom-up (append projectile-project-root-files-bottom-up cider-build-tool-files)) to get them all. Still confused as to why projectile would impact project.el, I thought they were independent. Could it be doom-emacs messing with this ?

narimiran 2026-05-28T09:16:51.209369Z

Whatever is causing this, it wasn't there until recently. The same project I have problems with right now, worked flawlessly for past 6 months.

pieterbreed 2026-05-28T11:11:12.538159Z

The solution I used (empty clj/.projectile ) is a little awkward in practice. My projectile-find-file now hides all the files not in clj/**.

pieterbreed 2026-05-28T11:21:42.272039Z

I confirmed that I get the same behaviour from modifying projectile-project-root-files-bottom-up in the way above. Is this a problem for others or just me?

narimiran 2026-05-28T15:23:20.962229Z

cc @bozhidar

bozhidar 2026-05-29T09:08:37.086629Z

I’ll take look when I can. Seems I’ve messed something up while trying to simplify the jack-in logic recently. Sorry about that!

🙏🏽 1
bozhidar 2026-05-29T09:55:35.863299Z

I’ve pushed a fix that should solve the issue. I most the project root resolution from clojure-mode to cider to avoid having to depend on clojure-mode for it, but in my attempt to make the code “smarter” I made a very silly mistake. I’ll think more about the overall approach here, but things should work for now.

rolt 2026-05-29T14:57:36.179119Z

thanks that solved the issue for me

bozhidar 2026-05-29T14:57:53.038769Z

Glad to hear this!

narimiran 2026-05-29T15:42:28.608369Z

Solved the problem for me too. Thanks @bozhidar for a quick fix!!

pieterbreed 2026-05-29T17:25:04.865509Z

I just updated and tested, it works like before, thank you for the fix @bozhidar 🙏🏽

Jim Newton 2026-05-27T15:12:25.263449Z

I had a live coding exercise today with cider that didn’t go well. I had a bug in my code which was an infinite loop. When I pressed C-M-x it never returned. How can I interrupt this and continue? I ended up killing the buffer several times and restarting slime.

clyfe 2026-05-27T15:20:40.622749Z

cider-interrupt

👍 1
clyfe 2026-05-27T15:28:56.237019Z

also note https://nrepl.org/nrepl/installation.html#jvmti

rolt 2026-05-27T15:36:22.754399Z

and https://docs.cider.mx/cider/usage/code_evaluation.html#enable-evaluation-interrupts-on-java-21-and-newer if you start the nrepl from cider

Jim Newton 2026-05-28T08:20:44.021749Z

> cider-interrupt do you mean M-x cider-interupt ?

Jim Newton 2026-05-28T08:28:30.378219Z

@rolthiolliere sorry, i took a look at the links you suggested. I think i’m missing too much background information about how cider works to relate these paragraphs to action I should take to ameliorate my problem. I don’t understand how cider and nrepl work, I’m just a user. What should I do if I want to interrupt an infinite loop launched by C-M-x ?

rolt 2026-05-28T09:08:54.990209Z

yes M-x cider-interrupt, (or C-c C-c). If you use java 21 you need to add the nrepl agent when launching it. The doc I sent was only to automatically add the correct argument to the nrepl launch command, in case you start the nrepl with cider-jack-in So basically, if you use java 21 or above: • if you start nrepl from your terminal and then connect to it with cider-connect: follow nrepl doc • if you use cider-jack-in: follow the cider doc (https://docs.cider.mx/cider/basics/up_and_running.html#enabling-nrepl-jvmti-agent)

clyfe 2026-05-28T09:13:55.136369Z

I have :aliases {:dev {:jvm-opts ["-Djdk.attach.allowAttachSelf"]} in my deps.edn and ((clojure-mode . ((cider-clojure-cli-aliases . ":dev")))) in .dir-locals.el

Jim Newton 2026-05-29T14:32:05.137659Z

if i’m using cider-jack-in do I need to do what the IMPORTANT section says, or only if I’m using cider-connect ?

Jim Newton 2026-05-29T14:33:08.850049Z

otherwise how am I supposed to do the following: > To enable the agent, the Java process should be launched with -Djdk.attach.allowAttachSelf. I don’t understand how to launch the java process with that flag

Jim Newton 2026-05-29T14:33:42.533089Z

to me the documentation is contradictor or at least confusing

rolt 2026-05-29T14:34:19.917639Z

if you're using cider-jack-in you can add this to .dir-locals.el for projects that use java 21:

((cider-mode . ((cider-enable-nrepl-jvmti-agent . t))))

Jim Newton 2026-05-29T14:36:02.421119Z

ahh I need to do this in every project that uses java 21 and higher?

rolt 2026-05-29T14:36:09.550709Z

or in your emacs config:

(use-package 'cider
  :config (setq cider-enable-nrepl-jvmti-agent t))

rolt 2026-05-29T14:38:22.018779Z

> ahh I need to do this in every project that uses java 21 and higher? maybe it has no effect for older versions, maybe it crashes, not sure. I use java 21 everywhere so I enabled that globally

Jim Newton 2026-05-29T14:38:31.980309Z

Here is the relevant section in my .emacs file.

(custom-set-variables
 '(ispell-program-name "/usr/local/bin/ispell")
 '(package-selected-packages
   '(cider clojure-mode csv-mode exec-path-from-shell flycheck
           flycheck-clj-kondo hl-sexp lsp-metals lsp-mode lsp-ui magit
           markdown-mode paredit sbt-mode scala-mode use-package w3m
           yasnippet))
 '(safe-local-variable-values
   '((ispell-personal-dictionary . "../francais.dict")
     (TeX-master . "../th-langage") (Package . CL-FAD)
     (TeX-master . t) (Base . 10) (Package . CL-PPCRE)
     (Syntax . COMMON-LISP))))

Jim Newton 2026-05-29T14:39:05.698679Z

do i ALSO need a use-package call?

rolt 2026-05-29T14:39:12.815379Z

no

Jim Newton 2026-05-29T14:41:12.316199Z

BTW is this a bug in cider, or it is it really intended that every user of cider enable interrupting an infinite or long evaluation?

Jim Newton 2026-05-29T14:46:27.070879Z

in my case cider-interrupt is bound to C-c C-b, while C-c C-c is bound to cider-eval-defun-at-point. Is that normal?

Jim Newton 2026-05-29T14:48:56.640929Z

it could be that during my live demo, I was pressing C-c C-c to interrupt, and it was rather re-evaluating …. 😞

rolt 2026-05-29T14:52:53.728589Z

that JVM setting is not enabled by default because "some hardened environments forbid self-attach" (from that variable documentation)

rolt 2026-05-29T14:53:35.654719Z

you're right it's C-c C-b by default, must be my config

Jim Newton 2026-05-30T05:56:39.787319Z

in slime (common lisp version of cider) C-c C-c is the normal way to compile and exec the current form. I don’t know whether i’ve set this in cider to have the more-or-less-same behavior, or whether that’s the default behavior.

Jim Newton 2026-05-30T05:58:21.798139Z

anyway, i’ve set the elisp variable (setq cider-enable-nrepl-jvmti-agent t) and now C-c C-b seems to interrupt a running evaluation correctly. Thanks for the help. Also, sorry for the long delays in responding. I’m a bit too distracted these few days.

enn 2026-05-27T19:46:24.348509Z

Can I do something in a global UncaughtExceptionHandler that will reliably cause a stacktrace to show up in CIDER, no matter what thread threw the exception? (either in the REPL buffer or a separate error buffer).

oyakushev 2026-05-30T20:07:44.771279Z

There is https://github.com/clojure-emacs/cider/issues/3850 to track this feature. I was planning to make a PoC sometime next month