This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-03
Channels
- # beginners (98)
- # boot (18)
- # chestnut (2)
- # cider (90)
- # cljdoc (3)
- # cljs-dev (1)
- # clojure (64)
- # clojure-dev (14)
- # clojure-dusseldorf (4)
- # clojure-italy (11)
- # clojure-nl (5)
- # clojure-spec (9)
- # clojure-uk (69)
- # clojurescript (63)
- # code-reviews (2)
- # core-logic (20)
- # cursive (13)
- # datomic (52)
- # dirac (2)
- # emacs (4)
- # figwheel (6)
- # hyperfiddle (13)
- # luminus (4)
- # nrepl (1)
- # off-topic (7)
- # onyx (9)
- # overtone (3)
- # parinfer (3)
- # pedestal (1)
- # re-frame (31)
- # reagent (74)
- # reitit (34)
- # rum (3)
- # shadow-cljs (51)
- # spacemacs (22)
- # specter (7)
- # tools-deps (23)
- # uncomplicate (3)
- # vim (9)
Btw, not sure if I mentioned it here or not, but shadow-cljs also supports the new nREPL. We’re almost completely done. 🙂
[nREPL] Direct connection to localhost:62698 established
error in process filter: user-error: Piggieback is not available. See for details
error in process filter: Piggieback is not available. See for details
Is it possibile (maybe in .dir-locals.el
) to specify a default build when the CLJS REPL is run with figwheel-main
? Just to bypass the prompt
ok, obviously you already thought of that: cider-figwheel-main-default-options
. Thanks!
1. Reinstalled spacemacs 2. Freshly create project with luminus template 3. Try to run clj and cljs repl together 4. ERROR!!!
[nREPL] Starting server via /usr/local/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.18.0-SNAPSHOT\"\] -- repl :headless :host ::...
[nREPL] server started on 62773
[nREPL] Establishing direct connection to localhost:62773 ...
[nREPL] Direct connection to localhost:62773 established
[nREPL] Establishing direct connection to localhost:62773 ...
[nREPL] Direct connection to localhost:62773 established
error in process filter: user-error: Piggieback is not available. See for details
error in process filter: Piggieback is not available. See for details
mwheel-scroll: End of buffer [19 times]
I don’t see piggieback injected in the command line string you’ve shown, so I assume it’s not a dependency of your project as well.
How about
:figwheel
{:http-server-root "public"
:nrepl-port 7002
:css-dirs ["resources/public/css"]
:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
instead of having :nrepl-middleware
in repl-options
?Is there anyway in lein
to configure the middleware that is used by cider-nrepl
- rather than just taking all the defaults? If so, can it not be accomplished via the plugin?
Pretty sure I have hit a problem with cider.nrepl.middleware.out/print-stream
, which is in the wrap-out
middleware.
Using figwheel + piggieback, during a CLJS compilation pass, it looks like (resolve *out*)
returns nil
and I get a NullPointerException here - I think the bound *ns*
is cljs.user
at the time and potentially is why.
Anyways, that’s some more background, but in general, I am now just wondering about the configurability of the middleware that you get with cider-nrepl
I have ob-clojure loaded up, and org installed via source, but it doesn't seem to be able to connect to CIDER
i followed the instructions here: https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-clojure.html
https://github.com/stardiviner/ob-clojure-literate in case the internet comes knocking
today I learned this, for .dir-locals.el
awesome!
((nil . ((projectile-grep-default-files . '("*.clj" "*.cljs" "*.cljc"))
(cider-preferred-build-tool . "clojure-cli")
(cider-default-cljs-repl . shadow-select)
(cider-clojure-cli-global-options . "-A:test:dev")
(mode . cider)))) <- super useful!
> Is there anyway in lein
to configure the middleware that is used by cider-nrepl
- rather than just taking all the defaults? If so, can it not be accomplished via the plugin?
You’ll have to list all the middlewares you want to use in Lein’s repl options. You can use the plugin for this, as it generate options with all the middleware in it. 🙂 We can probably improve the plugin, but no one asked about this.
Be sure to also report the bug you encountered. There’s also a config somewhere to disable this particular middleware as not everyone likes it. Don’t remember the exact name, though.
@bozhidar Ok, I wasn’t sure if I could list them all there. I was thinking it was a “whitelist” only thing and not a “blacklist” - meaning I have to list everything i want to leave 1 out.
I haven’t seen anything about how to disable with-out
middleware
I’m still hunting down a complete understanding, but there is an issue having resolve
called during macroexpansion in CLJS compilation.
The code was actually calling (.println System/out ^String s)
, but this middleware has System/out
set to something that uses resolve
. resolve
results in nil
, so there is a NPE due to it assuming (resolve *out*)
won’t be nil
in this with-out
middleware.
I’m trying to use CIDER more effectively. I just tried using cider-eval-last-sexp-and-replace
, great functionality. However, when doing so in a CLJS file, using a function I’ve defined after starting the repl, I get
#object[TypeError TypeError: Cannot read property 'call' of undefined]
This is regardless of whether I do cider-load-buffer
beforehand.
Oh, and the sexp gets replaced with nil
.
So, a sequence like this:
;; This is my buffer initially
(defn add [x]
(+ x 10))
(add 30)
;; If I do cider-eval-last-sexp-and-replace here, the sexp gets replaced by 40
;; Now I add a new function
(defn subtract [x]
(- x 3))
;; and save the file, and do cider-load-buffer
(subtract 10)
;; If I do cider-eval-last-sexp-and-replace here, the sexp gets replaced by nil, and I get #object[TypeError TypeError: Cannot read property 'call' of undefined] in the repl
If I eval the sexp calling subtract
after calling cider-load-buffer
, I get the same error and returning nil
as the result.
If I send the subtract
definition to the repl first and then send the calling sexp, I get the correct behaviour.
The implication is that for every sexp that I would like to call cider-eval-last-sexp-and-replace
(or similar functionality), I would first need to send each of the vars involved to the repl… individually.
Rather than just loading in all buffers to my repl.
@dpsutton do you follow?
> f I eval the sexp calling subtract
after calling cider-load-buffer
, I get the same error and returning nil
as the result.
this is a bug here. that needs to be solved before anything else happens
there's no sense in doing anything if you have undefined things after calling cider-load-buffer
True that
I thought it was related to the eval
functionality only, but it’s a general problem. Hm.
I get no errors in my cljs repl when loading in the buffer, but I do get an error in the browser console
Hadn’t noticed that
It’s a Figwheel repl
ioc_helpers.cljs?rel=1532007149410:42 Uncaught TypeError: goog.net.jsloader.load is not a function
i wish i could help you further but i think things are breaking before CIDER gets a chance to have a bug 🙂
oh yeah, I think you’re right about that 🙂
cheers!
@bozhidar > Be sure to also report the bug you encountered. There’s also a config somewhere to disable this particular middleware as not everyone likes it. Don’t remember the exact name, though. I did this https://github.com/clojure-emacs/cider-nrepl/issues/542
Middleware can only be whitelisted with lein, that’s true, but… This middleware has to be explicitly initialized when a connection is established and when this option is nil
it won’t be initialized.
I think it can be reproduced easily:
(ns fail-wrap-out-middleware
(:refer-clojure :exclude [*out*]))
(.println System/out "10")
@dpsutton I figured it out. Had updated my figwheel dep without also updating piggieback and figwheel-sidecar. CIDER works great now! 😄
