cider

Harold 2025-03-02T05:18:16.631679Z

I got a deps.edn node cljs repl in cider for the first time today (very cool). It's mostly working, one odd behavior in thread... 🧵

Harold 2025-03-02T05:18:53.590989Z

When typing things in the repl, I keep getting switched back to the cljs.user namespace:

;; Connected to nREPL server - 
;; CIDER 1.17.1 (Cologne), nREPL 1.3.1
;; Clojure 1.12.0, Java 11.0.26
;;     Docs: (doc function-name)
;;           (find-doc part-of-name)
;;   Source: (source function-name)
;;  Javadoc: (javadoc java-object-or-class)
;;     Exit: <C-c C-q>
;;  Results: Stored in vars *1, *2, *3, an exception in *e;
;;  Startup: /usr/local/bin/clojure -Sdeps \{\:deps\ \{nrepl/nrepl\ \{\:mvn/version\ \"1.3.1\"\}\ cider/cider-nrepl\ \{\:mvn/version\ \"0.52.1\"\}\ cider/piggieback\ \{\:mvn/version\ \"0.5.3\"\}\}\ \:aliases\ \{\:cider/nrepl\ \{\:main-opts\ \[\"-m\"\ \"nrepl.cmdline\"\ \"--middleware\"\ \"\[cider.nrepl/cider-middleware\,cider.piggieback/wrap-cljs-repl\]\"\]\}\}\} -M:cider/nrepl
;;
;; ClojureScript REPL type: node
;; ClojureScript REPL init form: (do (require 'cljs.repl.node) (cider.piggieback/cljs-repl (cljs.repl.node/repl-env)))
;;
To quit, type: :cljs/quit
niluser> 
cljs.user> (+ 1 2 3)
6
cljs.user> (require '["fs" :as fs])
nil
cljs.user> (str (fs/readFileSync "./deps.edn"))
"{:deps {org.clojure/clojurescript {:mvn/version \"1.11.132\"}}}\n"
cljs.user> (in-ns 'foo.bar)
nil
foo.bar> (* 6 7)
42
cljs.user>

Harold 2025-03-02T05:20:26.381109Z

It looks like this was encountered, and fixed, about a decade ago (!) https://github.com/clojure-emacs/cider/issues/909 I wonder if I'm doing something silly. Is there anything I can try before opening an issue on the cider repo? Thanks as ever for your time and consideration - I live inside cider and it's lovely.

oyakushev 2025-03-02T07:29:24.658789Z

Hello, the bug could resurface after recent nrepl changes. Could you please post a brief reproducer? I'll take a look

Harold 2025-03-02T15:24:05.229629Z

Thanks! Here's the new issue: https://github.com/clojure-emacs/cider/issues/3781

❤️ 1