Fork me on GitHub
#cider
<
2021-10-21
>
Christian Johansen07:10:47

After jack-in-cljs, and then opening the app in a browser I often get this exception:

1. Unhandled clojure.lang.ExceptionInfo
   Expected REPL Connections Evaporated!
   {:type :js-eval-exception,
    :error
    {:status :exception,
     :value "Expected REPL Connections Evaporated!",
     :stacktrace "No stacktrace available."},
    :form (set! cljs.core/*print-namespace-maps* true),
    :js "(cljs.core._STAR_print_namespace_maps_STAR_ = true)"}
This results in no working figwheel REPL in cider, but the rest of the figwheel process works as expected (e.g. it still compiles and reloads). Any pointers to some options I can tweak to avoid this?

Christian Johansen07:10:06

(This might be better directed at #figwheel-main, Iā€™m not exactly sure)

Christopher Miles15:10:18

I'm having problems with Emacs and Cider on Windows using a deps.edn file, I was wondering if anyone else had issue with this combination. We have an alias in this project called "dev" that includes the paths to the project source but I can't seem to get Cider to set that path. I can try to edit the command, but it's a big blob of base64 encoded text.

vemv16:10:31

I can't help much here however you might have better luck by launching a nrepl (+ cider-nrepl, refactor-nrepl) process from a terminal and then running cider-connect against that It's a more transparent approach if just a little more manual

šŸ‘ 1
Christopher Miles16:10:08

Yes, you are correct: that's the only thing that's worked for me so far. The "escaping quotes" section on the clj-on-windows project page kind of hints that something nutty is happening. https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows#escaping-quotes

šŸ˜Æ 1
vemv16:10:12

I'd guess that not many maintainers hack on Windows so you might find something interesting / PR-able by inspecting the source and evaling various forms in an Elisp repl. Else you can always report an issue over GH

Christopher Miles17:10:10

I can't seem to make it work, I wonder if there's something weird happening that is preventing it from seeing the deps.edn file. I did submit an issue. šŸ™‚ https://github.com/clojure-emacs/cider/issues/3079

Christopher Miles19:10:25

Thanks @U45T93RA6, setting the cider-clojure-cli-aliases variable did resolve my problem.

cider 1
richiardiandrea15:10:03

Hi folks, I am trying to install clj-refactor from source but I have some problem finding the inflections package's source - where does the project live?

richiardiandrea16:10:28

Hi there, today is nrepl day. I thought I knew how to do this but when I start nrepl this way

(nrepl-server/start-server :port port
                                          :address bind-address
                                          :middleware [#'cider.nrepl/cider-middleware #'refactor-nrepl.middleware/wrap-refactor])
I get the warnings that functions may not be available... I tried symbols as well to no avail, is there anything there obviously wrong I am doing?

richiardiandrea16:10:09

Oh, did :middleware disappear on start-server?

dpsutton16:10:47

its not there. i think you create a handler with middleware

dpsutton16:10:32

for your handler i think you want cider.nrepl/cider-nrepl-handler

dpsutton16:10:49

which is just

(def cider-nrepl-handler
  "CIDER's nREPL handler."
  (apply nrepl-server/default-handler (map resolve-or-fail mw/cider-middleware)))

richiardiandrea17:10:25

This is what eventually worked:

(def custom-nrepl-handler
  "We build our own custom nrepl handler, mimicking CIDER's."
  (apply nrepl-server/default-handler (conj cider.nrepl.middleware/cider-middleware 'refactor-nrepl.middleware/wrap-refactor)))
The fact is that cider-middleware is actually middleware*s* and you need to add the refactor-nrepl one to it

vemv17:10:46

probably we should have an 'official' snippet for this, or if it's around in the docs already it should be more easily discoverable.