This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-25
Channels
- # 100-days-of-code (3)
- # beginners (80)
- # cider (53)
- # cljdoc (9)
- # cljs-dev (66)
- # cljsrn (6)
- # clojure (108)
- # clojure-austin (5)
- # clojure-dusseldorf (1)
- # clojure-italy (9)
- # clojure-losangeles (2)
- # clojure-nl (4)
- # clojure-spec (40)
- # clojure-uk (46)
- # clojurescript (60)
- # cursive (119)
- # datomic (28)
- # emacs (10)
- # events (1)
- # figwheel-main (21)
- # fulcro (16)
- # hyperfiddle (10)
- # immutant (2)
- # leiningen (1)
- # liberator (5)
- # nyc (1)
- # off-topic (36)
- # onyx (4)
- # pedestal (52)
- # portkey (5)
- # re-frame (11)
- # reagent (11)
- # shadow-cljs (46)
- # sql (1)
- # unrepl (2)
I’m trying out the ion starter project: https://github.com/Datomic/ion-starter/blob/master/deps.edn
@martincharlesrichards I think you’re looking for cider-clojure-cli-global-options
, some documentation about it here: https://cider.readthedocs.io/en/latest/up_and_running/#launch-an-nrepl-server-and-client-from-emacs
Hello, does anybody has experience with running a nREPL server from a docker container?
I was trying to connect to a nREPL server in my app within a docker container using cider-connect
, but then it returns "Sync nREPL request timed out". I've exposed the nREPL port in the Dockerfile and binded the port to my host machine. Running the same server outside of docker and connect a cider client to it was successful, so I guess there's something with docker which I don't understand yet.
@hawari.rahman17 We (Magnet Coop) do it all the time.
We launch Leiningen to listen on 0.0.0.0:your-port-of-choice
. If you launch it to listen on localhost
or 127.0.0.1
, then it isn't reachable from outside the docker container.
Hi @iarenaza, I didn't run the repl via leiningen, but rather by embedding it in my application code like this: https://nrepl.readthedocs.io/en/latest/usage/#embedding-nrepl-starting-a-server Should I refrain from it and just run a nREPL server with leiningen? I asked because my final docker image tends to only have JVM inside it to run the uber jar I've built.
We don't embed nREPL in our production apps, that's why we use leiningen (during development). In any case, it shouldn't matter if you embed it or launch it via leiningen. You should make sure your nREPL server is listening on a host + port combination that is reachable from outside the container. The thing is, if you don't specify a host address to listen on when starting the nREPL server, it uses localhost
by default. And localhost
is not reachable from outside the docker container (docker uses a separate network namespace for the host's loopback interface and the container's loopback interface, so they don't see each other).
I see, I've tried to run the embed nREPL with :host "0.0.0.0"
though it still doesn't work
I have just checked the source code (couldn't find this info in their docs) and the keyword you need to use is :bind
, instead of :host
. See https://github.com/nrepl/nREPL/blob/master/src/clojure/nrepl/server.clj#L108-L109
Oops, let me try that @iarenaza, I should've delved to the source code in the first place
@iarenaza Good man! I’ve added a few small remarks. Might also be a good idea to add a couple of code snippet alongside the extra explanations you’ve added.
I regularly run the tests of the current ns (a binding that saves and fires up the tests)
@macroz The point is that the middleware doesn’t support ClojureScript and you can’t get the nice CIDER test UI and all its features without it.
If I recall correctly the middleware was written before cljs.test
existed and never added support for it.
https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/test.clj
And here’s an example of middleware that supports ClojureScript https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/complete.clj#L15
Note that you can’t evaluate any ClojureScript code in the middleware (currently), which is the real challenge with the ClojureScript support.
The only thing we currently have access to is the ClojureScript compiler environment,.
More details here - https://github.com/clojure-emacs/cider/issues/1416
It’s not that much really, but I don’t have much time for OSS these days and we’re short on contributors in general.
finding some time to contribute is not a problem but grokking such a big piece of software takes time
One more thing I’m struggling right now, I updated cider and cider-nrepl to latest ‘0.18.0’ and renamed cider-refresh
to cider-ns-refresh
in my elisp.
(setq cider-ns-refresh-before-fn "reloaded.repl/stop"
cider-ns-refresh-after-fn "reloaded.repl/go")
However, refresh fails with next exception initially and then doesn’t work
2018-09-25T17:09:18.330+0000 Bucephalus.local ERROR [clojure.tools.nrepl.server:286] - Unhandled REPL handler exception processing message {:op refresh, :print-length 50, :print-level 50, :pprint-fn clojure.pprint/pprint, :before reloaded.repl/stop, :after reloaded.repl/go, :session 86307587-a001-4181-bacf-c61e003920e4, :id 68}
@rmuslimov I found a bug in cider-refresh the other day. How do you start cider?
That’s just clojure project (soap server), I’m starting cider by calling C-c M-j
. I’m using reloaded.repl
for system management
I have updated my ~/.lein/profiles.clj
file from
{:repl {:plugins [[refactor-nrepl "0.2.4"]
[cider/cider-nrepl "0.19.0-SNAPSHOT"]]}}
to
{:plugins [[refactor-nrepl "0.2.4"]
[cider/cider-nrepl "0.19.0-SNAPSHOT"]]}
And code-reloading working in lein repl
, however, all interactions with cider are dead now. If I start cider-jack-in connections stucks (never returns), if I do cider-connect
and try to refresh I got
user-error: 'cider-ns-refresh' requires the nREPL op "refresh". Please, install (or update) cider-nrepl 0.18.1-SNAPSHOT and restart CIDER
but there is not that version 0.18.1-snapshot
of cider-nrepl. Ah, cider is magic but maintaining projects with clojure and cider can be become time-expensive thingAnd jack-in
is stuck, because something dramatical happens inside of cider when I’m doing (inc 1)
in repl
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: parse/deps-from-ns-decl, compiling:(cider/inlined_deps/toolsnamespace/v0v3v0_alpha4/clojure/tools/namespace/file.clj:64:26)
not sure what it means