Fork me on GitHub
David Pham08:11:44

I was wondering if anyone had some issue with cider-load-buffer with conditional reads and a clojure/jvm process? I get the error conditional reads are not allowed, so I resort to call cider-eval-buffer , is this expected? I am sorry if the question is trivial.


assuming the file is a .cljc one it does sound like a bug


Hello, does anyone happen to make work with cider ? (currently it obviously fires the error that says that there is no 'is' defined in tests)


I think e.g. @U06QSF3BK is using Emacs / Cider. I'm a Cursive guy myself. 🙂


I now use clojure-lsp also! 🙂


on metosin/testit > Deprecated: not actively maintained nor recommended for new projects


but if you have it already, might not be worth to replace


@U76D9RZRR thanks for the redirect! @U06QSF3BK ok interesting, may be I should try clojure-lsp too though currently everything seems to work fine with cider except tests currently. Unfortunately have to support lots of testit-based codebase even it's deprecated.


perform walk/macroexpand-all on a deftest and see whether in fact is has an is somewhere CIDER doesn't perform an heuristic, it just runs whatever you throw at it so it if contains an is (via macroexpansion), it should work


@U06QSF3BK but from the clojure-lsp docs I got the impression that it tries to leverage cider's run-tests so I would end up with the same problem


too fast reply, so clojure-lsp just static analysis


This doc says that cider run-test looks into metadata for filtering tests


I haven't used midje style things myself, and haven't used metosin/testit, which seems to use clojure.test, so would think that loading a namespace with vars created by deftest should still work with cider


have you loaded the namespace into repl?


yes, I did and here is the macroexpand results:

 (fn* ([] (clojure.test/test-var #'my-test))))
may be I am doing something wrong (or not doing smth)


oh! suddenly it started to work, don't know what I did though :)) suuri kiitos @U06QSF3BK


Eipä kestä! 🙂


CIDER cares only that the clojure.test protocol being implement by some particular library and it should work fine.


I’ve avoided adding native support for different libraries as that’s a pretty slippery slope, plus in most cases you can easily run whatever tests you have in the REPL.


makes lots of sense! though this midje reference forced me to look into the different direction (emidje) @U051BLM8F Thanks for the amazing package!


Does anyone have tips on how to debug a shadow-cljs repl not connecting with cider-connect-clj&cljs? I end up with two clj repls. Here's what I'm seeing in *Messages*:

[nREPL] Establishing direct connection to localhost:50636 ...
[nREPL] Direct connection to localhost:50636 established
[nREPL] Establishing direct connection to localhost:50636 ...
[nREPL] Direct connection to localhost:50636 established
user-error: The shadow-cljs ClojureScript REPL is not available.  Please check  for details
Version info:
;; Connected to nREPL server - 
;; CIDER 1.2.0snapshot (package: 20211108.621), nREPL 0.8.3
;; Clojure 1.10.3, Java 11.0.1
The project seems to be running fine. I see this in the js/console: shadow-cljs: #3 ready! and everything at http://localhost:9630/dashboard looks fine (although I'm new to using shadow-cljs). I'm just not sure where to look next. Does anyone know where I should look next?


Oh, more info: I'm choosing shadow-select on the :main build. Some extra deps for the clojure repl:

 {nrepl/nrepl {:mvn/version "0.8.3"}
  refactor-nrepl/refactor-nrepl {:mvn/version "3.0.0"}
  cider/cider-nrepl {:mvn/version "0.27.2"}}
 ["-m" "nrepl.cmdline" "--middleware" "[\"refactor-nrepl.middleware/wrap-refactor\",\"cider.nrepl/cider-middleware\"]"]}


Well, immediately after I post here I found this: Perhaps this is more of a shadow-cljs issue. I'll study this and maybe post over in #shadow-cljs if I still can't figure it out.


@U067Q76EP perhaps try: M-x cider-connect - select localhost and the nREPL port. Then M-x cider-connect-sibling-cljs


Not sure if that will be any different, but perhaps will bubble up a helpful error?


Yeah, same issue. Thanks for the suggestion though.


Do you have the appropriate :deps {:aliases [:your-alias]} in shadow-cljs.edn?


Yeah, it's just this code with the :sql and :xtdb aliases deleted.


I shouldn't say "just" there. It's a pretty complex set of dependencies. I bet there's something wrong in there but I'm just not sure how to debug it yet.


The error you’re getting seems to indicate that the shadow-cljs library is not loaded, as CIDER does a trivial check to see if something is around, so it can invoke code from it safely.


(defun cider-check-shadow-cljs-requirements ()
  "Check whether we can start a shadow-cljs REPL."
  (unless (cider-library-present-p "shadow.cljs.devtools.api")
    (user-error "The shadow-cljs ClojureScript REPL is not available.  Please check  for details")))


Basically it’s a namespace check.


If you think this has backfired for you, there’s a defcustom to disable such checks.


See cider-check-cljs-repl-requirements.


I figured it out. It turns out I was connecting to a clj repl insterad of a cljs one. I thought I was supposed to connect to a clj one and it would start a cljs repl, but I was wrong.


Well, mostly figured out. cider-connect-clj&cljs only works with one of them depending on if I give it the clj port or the cljs port. I can call cider-connect-clj then cider-connect-cljs and that works.