This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-05
Channels
- # adventofcode (246)
- # aleph (5)
- # aws (7)
- # beginners (161)
- # boot (3)
- # calva (42)
- # cider (40)
- # clara (10)
- # cljdoc (7)
- # cljs-dev (40)
- # cljsrn (6)
- # clojure (170)
- # clojure-dev (8)
- # clojure-greece (2)
- # clojure-italy (15)
- # clojure-kc (2)
- # clojure-new-zealand (13)
- # clojure-nl (13)
- # clojure-russia (3)
- # clojure-spec (5)
- # clojure-uk (160)
- # clojurescript (72)
- # clojurex (1)
- # cursive (7)
- # data-science (9)
- # datascript (1)
- # datomic (120)
- # devcards (4)
- # emacs (18)
- # figwheel-main (10)
- # fulcro (34)
- # kaocha (3)
- # luminus (1)
- # lumo (6)
- # music (1)
- # nrepl (23)
- # off-topic (2)
- # pedestal (4)
- # re-frame (42)
- # reagent (36)
- # reitit (10)
- # ring-swagger (21)
- # shadow-cljs (124)
- # spacemacs (6)
- # tools-deps (14)
- # unrepl (3)
- # vim (2)
Using boot with emacs calling cider-jack-in-cljs
produces this error. Anyone seen this before? quickfix?
The codebase that it's being run from is here: https://github.com/district0x/cljs-ipfs-native/blob/cors-fix/build.boot
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?
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.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
@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
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.
Thanks, I’ll look.
I think this might do it, https://stackoverflow.com/questions/12329677/how-to-stop-ring-server-started-using-ring-util-serve
@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
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?
@bozhidar Would you kindly rebuild cider-nrepl? I fixed a bug in compliment that may annoy people (it did me)
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
@alexyakushev Done. 🙂
@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
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 🙌
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.
There are some details here http://www.cider.mx/en/latest/managing_connections/
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