This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-26
Channels
- # admin-announcements (2)
- # aws (1)
- # beginners (21)
- # boot (61)
- # cider (5)
- # cljs-dev (94)
- # cljsrn (35)
- # clojure (106)
- # clojure-austin (3)
- # clojure-belgium (1)
- # clojure-dev (4)
- # clojure-dusseldorf (9)
- # clojure-greece (2)
- # clojure-mexico (1)
- # clojure-russia (40)
- # clojure-spec (61)
- # clojure-uk (17)
- # clojurescript (151)
- # code-art (1)
- # component (7)
- # core-async (4)
- # cursive (1)
- # datomic (9)
- # dirac (55)
- # funcool (12)
- # hoplon (118)
- # incanter (12)
- # jobs (8)
- # juxt (1)
- # lein-figwheel (6)
- # mount (2)
- # off-topic (2)
- # om (76)
- # onyx (28)
- # other-lisps (1)
- # planck (7)
- # re-frame (9)
- # reagent (13)
- # ring-swagger (2)
- # specter (1)
- # yada (22)
After running (dirac! :join)
, trying to eval anything gives me an error like this:
dirac.lib.nrepl-tunnel-server | [NREPLTunnelServer#1 of [NREPLTunnel#1]] Received an error from client [WebSocketServerClient#1] :
| {:err
| "Unable to unserialize forwarded nREPL message:\n {:ns \"frontend.core\", :file \"*cider-repl localhost*\", :op \"eval\", :column 15, :line 54, :pprint-fn #function[cider.nrepl.middleware.pprint/wrap-pprint-fn/fn--24400/fn--24402], :id \"15\", :code \"1\\n\"}",
| :op :error,
| :id "01100e8b-53ed-4680-a514-83c9458097fc"}
Removing all other middleware is a good first step
most emacs users have cider-nrepl middleware in their ~/.lein/profiles.clj
though, so it would be hard to convince my team to remove it š
ok, looking at the code, the whole problem is that the message is unserialisable on client side because of that :pprint-fn key, not sure why they include this key there in a form which is not portable background info: when you switch your session into joined dirac session (meaning joined to some āsourceā session), I send all incoming nrepl messages (e.g. āeval" requests) to your joined session to client-side to be processed by Dirac devtools, is can implement the nrepl message directly if appropriate or send it back to the āsourceā session for actual processing. In any case I need to unserialise the message on client side to look at the operation and act appropriately.
yes, we can easily make a hack to accommodate your case, but I would like to think about it more and find more general solution
I use read-string on client side, maybe I could use some other function which would skip unserializable keys or something, I donāt want to implement some nrepl message transformation on server side, if possible
this is the current implementation: https://github.com/binaryage/dirac/blob/master/src/implant/dirac/implant/intercom.cljs#L260-L264
you get back this response: https://github.com/binaryage/dirac/blob/master/src/implant/dirac/implant/intercom.cljs#L291
btw that error logging could tell you more about the problem, it gets logged into Diracās console (the console you can open from Dirac DevTools window)
I mean this line: https://github.com/binaryage/dirac/blob/master/src/implant/dirac/implant/intercom.cljs#L264
would be nice to look there to confirm my theory, I donāt really have cider stuff set up and running
I think all that's needed is to add something like [cider/cider-nrepl "0.11.0"]
to :plugins
in project.clj
and the issue should reveal itself in the lein repl
hmm, that means that this read-string returned nil without throwing? https://github.com/binaryage/dirac/blob/master/src/implant/dirac/implant/intercom.cljs#L262
Iām looking into cljs.reader/reader and clojure.edn/reader, not clear if any of them will be able to parse the message and somehow skip unparseable bits
looking at the docs of cljs.reader/read-string and it does not thow by default, just silently returns nil, so that is why we are not getting that error log
throwing can be enabled, that would be an improvement, but that would not solve our problem at hand
@frank: I was able to reproduce the issue, just looking at the devtools console and that read-string really throws: https://dl.dropboxusercontent.com/u/559047/hmm-throws.png note that ātroubles unserializing message"
I have there more messages because Iām running the dev build, maybe yours would look different
I will be able to fix it on client side, at least with tools.reader, we can specify our own "tag parsers"
also a workaround for you could be to exclude wrap-pprint-fn middleware: https://github.com/clojure-emacs/cider-nrepl#via-leiningen
btw. that :plugins approach didnāt work for me, I had to go :dependencies route and cofigure :repl-options myself
for some reason adding just cider-nrepl as plugin didnāt work with my project configuration somehow
@frank: realized that on nrepl (server) side checking for this makes more sense, but after implementing it on client side, so I kept both: https://github.com/binaryage/dirac/commit/e98d8b92877a62c828fffad392e57c26e0693650 https://github.com/binaryage/dirac/commit/7b4b4e1f76a6a21c598015b3050350b29ce621bc