This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-22
Channels
- # adventofcode (12)
- # announcements (6)
- # aws (5)
- # babashka (57)
- # beginners (40)
- # calva (17)
- # clojure-europe (10)
- # clojure-nl (1)
- # clojure-norway (21)
- # clojure-uk (3)
- # clojuredesign-podcast (4)
- # cursive (3)
- # datomic (9)
- # etaoin (5)
- # fulcro (12)
- # hyperfiddle (42)
- # missionary (2)
- # off-topic (11)
- # reagent (6)
- # scittle (131)
- # squint (3)
- # tools-deps (4)
- # uncomplicate (1)
- # vscode (1)
I'm trying to connect to scittle with CIDER following the exact instructions in https://github.com/babashka/scittle/tree/main/doc/nrepl, and am getting an exception:
Fri Dec 22 10:49:58 CET 2023 [worker-1] ERROR - handle websocket frame org.httpkit.server.Frame$TextFrame@53da070f
java.lang.RuntimeException: No reader function for tag object
Does anyone have any idea what might be going wrong here? I added the elisp snippet as directed.ah yes, httpkit is used here: https://github.com/babashka/sci.nrepl/blob/main/src/sci/nrepl/browser_server.clj
at clojure.edn$read_string.invokeStatic(edn.clj:46)
at clojure.edn$read_string.invokeStatic(edn.clj:37)
at clojure.edn$read_string.invoke(edn.clj:37)
I'm using the newest sci.nrepl commit now and can't repro this but nothing happens either
I see, the scittle/doc/nrepl stuff was already at the latest commit, but locally I wasn't on the latest commit
It seems this commit at least broke something: https://github.com/babashka/sci.nrepl/commit/2f8a9ed2d39a1b09d2b4d34d95494b56468f4a23 cc @U02CV2P4J6S And something else changed in CIDER I think because in the REPL window I can evaluate, but not from the buffer.
I reverted the handling of unknown nREPL ops to send
(send-response (assoc ctx :response {"status" #{"error" "unknown-op" "done"}}))
This seems to at least fix the EDN serialization errorPerhaps you can try that one @U054AT6KT? https://github.com/babashka/sci.nrepl/commit/2c3c18ebda189ae54fb2b3294b1f5ca609ed1b96
I might have a look at this later but right now I'm not in the mood to force-quit my emacs every time I try something...
please use scittle 0.6.15 https://github.com/babashka/scittle/releases/tag/v0.6.15 Also, when you did jack in clj, it didn't count as cljs currently, fix: https://github.com/clojure-emacs/cider/pull/3600 I suspect if you say connect cljs -> nbb its a workaround for the second issue right now. Cider hanging is probably because the scittle version is old. The current sci.nrepl implementation asks the scittle server for "describe". It was sort of a breaking change we thought would be tolerable, but yea
example sci.nrepl deps:
:deps
{sci.nrepl/sci.nrepl
{:git/sha "2f8a9ed2d39a1b09d2b4d34d95494b56468f4a23"
:git/url ""}}
@U02CV2P4J6S I used bb dev in this directory which uses 0.6.15: https://github.com/babashka/scittle/blob/main/doc/nrepl/index.html
@U02CV2P4J6S thanks for looking into this ❤️ does it work for you at all right now?
I'm running:
borkdude@m1 ~/dev/scittle/doc/nrepl (main) $ bb dev
Serving static assets at
Websocket server started on 1340...
nREPL server started on port 1339...
I'm going to open the web page and then do the connect sequence in emacsI am getting:
Fri Dec 22 13:47:16 CET 2023 [] ERROR - handle websocket frame org.httpkit.server.Frame$TextFrame@53d31621
java.lang.RuntimeException: No reader function for tag object
at clojure.lang.EdnReader$TaggedReader.readTagged(EdnReader.java:801)
in the server (like in the OP)
and emacs hangs. I didn't get any choices after doing cider-connect-clj
(this is why I did cider-connect-cljs
before)hahaha, after force quit, I get a popup from emacs if I want to save a file. when I then say no, then it works
yes, the EDN read issue is caused by the SCI context being part of the EDN response, which should be left out. I'm surprised this doesn't cause an issue with VSCode. It seems to happen when the version is requested by CIDER, an op which isn't implemented
I'm going to upgrade to cider 20231204.843 available melpa Clojure Interactive Development Environment that Rocks
I don't know why the heck we assoc the context here and in several other places: https://github.com/babashka/scittle/blob/9791c281e32bc11029ac6c99418045fba355596f/src/scittle/nrepl.cljs#L65
but even when I dissoc-ed it here https://github.com/babashka/scittle/blob/main/src/scittle/nrepl.cljs#L14-L17 it didn't completely work
@U02CV2P4J6S I think the context accidentally becomes part of the response on an unknown/unsupported nREPL op: https://github.com/babashka/scittle/commit/95740162d42bf4c9a2a17740c4eed07b0899229d
I forgot how to dev scittle. Want a repl to see what ctx does and where session and id should come from
I guess why vscode/calva works and emacs doesn't (before at least) is that nrepl should actually never try an op that isn't present in describe
(nrepl-reply msg (merge msg {:status ["error" "done"] :err "unkown-op"}))
this seems correct and seems to workthis fixes cider making emacs stuck and the parse edn error afaik. So there is some remaining issue where cider asks for version but shouldn't? I think on my end it does 'describe' and it turns out good.
:msg "{:prefix-rewriting \"false\", :ns \"nrepl-playground\", :err \"unkown-op\", :debug \"false\", :op :version, :insert-newline-after-require \"true\", :status [\"error\" \"done\"], :id \"5\", :session \"df085b44-b02d-4773-9d4f-3da662f225dd\"}"
ah the issue is it asks for op "version" and doesn't handle that it comes back with an error maybe
somewhere somebody asks for "version" and that is not right, they get an error back. its not on the default latest cider by default. But its annoying that cider doesn't truck along after an error
but it ends up in namespace nil
now and I still can't evaluate from the buffer, at least not with cider-connect-clj
but I don't even get the list of choices with connect-clj, I get the list of choices with connect-cljs
@U054AT6KT do you have clj-refactor installed in emacs? you could try without it and maybe that fixes it for you
ok, I'm fine with that, but you mentioned connect-clj before, this is why I tried it
well, it's somewhat less broken for me now after de-installing clj-refactor but not optimal. Calva works though
if you say connect cljs and nbb, it should also work. Unless my mental model is wrong.
the clj-refactor package still interferes somehow, might be something to check up on
I resorted to just using my cider-repl buffer, which worked after a few whacks on C-g. Couldn’t eval stuff from my code buffers, but I was at least able to REPL my browser.
I’m heading out on holiday now, but I’ll try some of the stuff in this thread if I get a chance.
Using the nbb CLJS REPL type does work for me, but CIDER still doesn't understand that my buffer is connected to that REPL, so I still have to resort to typing stuff into the REPL buffer directly. This is using CIDER 1.12.0 and uninstalling clj-refactor.
@U054AT6KT does it help if you switch to clojure-mode or clojurescript-mode?
depends on the output of cider-repls. I suppose that also has to do with the current mode. Hm; I thought cljs -> nbb should be a workaround 'till the scittle == cljs fix. @U45T93RA6 https://github.com/clojure-emacs/cider/pull/3600 this is the context for the pull request. I'm not getting to cleaning it up currently