Fork me on GitHub

Using boot with emacs calling cider-jack-in-cljs produces this error. Anyone seen this before? quickfix?


Is it possible i'm missing something?


Looks alright to me at first glance...I would check the dependency 🌲 because it seems somehow cljs.repl is missing...maybe. Do you have a bigger stack trace?

David Reno17:12:08

Given this project file, when I start my repl with lein ring server it presumably runs my ring handler in the specified namespace:

(defn -main []
  (jetty/run-jetty handler {:port 3000}))
. This works fine. When I start a cider session instead of running lein from the command line, I see this message and it doesn’t seem to run -main:
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.4.5\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.19.0-SNAPSHOT\"\] -- repl :headless :host localhost...
I’m sure I’m missing a couple of things, I’d appreciate any comments. My goal is to use cider in place of the command-line lein and have the jetty server run.

David Reno17:12:07

My best guess is that the project file key :main informs the REPL to automatically call -main and that maybe cider has a different REPL or something and can’t call -main automatically?


Cider will not run -main on startup. You can start cider and run -main manually. There is also M-x cider-run which will run the -main command in your project

David Reno18:12:49

@UDVJE9RE3, thanks! cider-run is the extra step I was missing. Still not clear to me what cider does differently WRT the REPL but I can figure that out over time.


It’s just starting a repl and not making any assumptions about what you want to do with it. I will usually have a separate user namespace with functions that has functions for me to start, stop, and restart a ring server that I use exclusively in cider. They will start ring and then return control to the repl so that I can continue to re-evaluate other forms as I work. Try playing around with different methods for working in cider and see what works for you

David Reno18:12:58

You don’t have any github links with that type of setup do you? I haven’t figured out how to do that “return control to the repl so that I can continue to re-evaluate other forms as I work” part.


I don’t unfortunately. It’s mostly been using component and compojure frameworks. Component has stuff for doing this for sure.

David Reno18:12:57

Thanks, I’ll look.

David Reno19:12:13

@UDVJE9RE3, with that link and others I’ve cobbled the following together which seems to do the following: 1. has a -main to start the server via lein and cider-run 2. :join? false seems to return to the repl and let me run other commands 3. (.start) and (.stop) let me restart the jetty server

(ns hello-ring.core
  (:require [ring.adapter.jetty :as jetty]
            [clojure.pprint :as pprint]))

(defn handler [request]
  {:status 200
   :headers {"Content-Type" "text/plain"}
   :body "hello world" })

(defonce -main (jetty/run-jetty #'handler {:port 3000 :join? false}))
;;(.stop -main)
;;(.start -main)
;;(str "hi")


That sounds about right. You may need :join? true for when you are starting from lein ring server. I believe it will start the server then exit immediately since there is nothing to block the main thread. Not 100% sure about that but you might want to test that out

👍 4

when entering cider debug mode with, in my case, C-u C-M-x I get clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: No reader function for tag dbg ... I've updated emacs to 26.1 and reinstalled leiningen with a new .lein to try to resolve this issue; most the posts online about this issue are from around 2015; thoughts?


so, I've replaced emacs; replaced my .lein; replaced my .m2 repo; replaced my .emacs.d and I'm still getting the 'No reader function for tag dbg' error... where else is state stored for emacs/lein/cider?


Did it ever work for you?


@bozhidar Would you kindly rebuild cider-nrepl? I fixed a bug in compliment that may annoy people (it did me)


I think cider will need a release soon just to be compatible with 1.10


when jumping to a namespace with C-c C-. — is there a way to be able to edit and evaluate stuff in the context of that buffer? I often use this kind of workflow to debug/interact with library code


> I think cider will need a release soon just to be compatible with 1.10


True. I plan to cut something before the end of the month.


@martinklepsch You can toggle read only and edit/eval. You’ll get some annoying auto-save errors if you don’t turn that off, but otherwise it does work.


@U0954HGDQ if you happen to know the commands from the top of your head, please share :) I guess I can google edit stuff but not sure about eval


eval is the same as for your files


C-x C-e, for example, or whatever you normally use


M-x read-only-mode to make the buffer editable


Oh and I guess I might have to use sesman to connect the buffer to an existing repl session


I thought I tried the regular eval stuff earlier but I’ll give it another go tomorrow, thanks 🙌


And, of course, you can’t save


I guess @martinklepsch is asking mostly because of the changes to session mapping in 0.18. He might have to associate buffers outside the current project manually.


Let me try real quick and verify it still works for me. I don’t do this every day, but it’s a fairly regular thing


yeah - works fine for me. M-. into something in a JAR dependency. M-x read-only-mode and then edit eval.


CIDER 0.18.1snapshot (package: 20181008.1547)


That’s because the friendly sessions were added after 0.18. 🙂


Oh - I thought you were saying something changed in 0.18 to make this not work.


I’ve been doing this for … a long time.