cider using scittle nREPL doesn't send forms to REPL
IrrenWirr opened this issue · comments
Expected behavior
Sending forms from .cljs buffer to the cider-repl... buffer using scittle's nREPL
(directly inputing forms into cider-repl... buffer works fine)
M-x cider-eval-last-sexp
expected to evaluate form or throwing an error
Actual behavior
Only a message echo "You can run the command ‘cider-eval-last-sexp’ with C-x C-e" without any information nor noticeable change.
Steps to reproduce the problem
setup scittle
git clone https://github.com/babashka/scittle
cd scittle
bb dev
output:
> clojure -M -m shadow.cljs.devtools.cli --force-spawn watch main
Serving static assets at http://localhost:1341
nREPL server started on port 1339...
Websocket server started on 1340...
open in browser
http://localhost:1341/nrepl.html
open in emacs
emacs -Q
M-x package-install cider
goto "./resources/public/cljs/nrepl_playground.cljs" file
M-x cider-connect-cljs
host 127.0.0.1
port 1339
custom (+ 2 3)
M-x cider-eval-last-sexp
somewhere in "nrepl_playground.cljs"
Environment & Version information
CIDER version information
;; Connected to nREPL server - nrepl://127.0.0.1:1339
;; CIDER 1.15.0 (Cogne)
scittle version
scittle v0.6.17
Emacs version
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0)
Operating system
Guix
Picture
but works fine when using M-x cider-connect-clj
instead of M-x cider-connect-cljs
maybe not a bug?
Hi @IrrenWirr , thanks a lot for the precise issue report.
Under your setup, what's the value of (cider-runtime)
? It should return scittle
- if it doesn't, that would likely have to do.
On buffer *cider-repl...* M-: (cider-runtime)
=> scittle
On buffer ...playground-cljs M-: (cider-runtime)
=>
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
cider--clojure-version()
cider-runtime()
eval((cider-runtime) t)
#f(compiled-function () #<bytecode -0x149634791cd8399e>)()
#f(compiled-function () #<bytecode -0x5db3e1955cb81d1>)()
eval-expression((cider-runtime) nil nil 127)
funcall-interactively(eval-expression (cider-runtime) nil nil 127)
command-execute(eval-expression)
What does (cider-current-repl)
return in the nrepl_playground.cljs
file?
also, cannot either do M-x cider-connect-sibling-cljs
on nrepl_playground.cljs
=> cider--no-repls-user-error: No clj or cljs REPLs in current session "dev/scittle:127.0.0.1:1339"
and creating a new session with M-x cider-connect-cljs
on nrepl_playground.cljs
: just create a new cider-nrepl without chaning the cider[not connected]
status of nrepl_playground.cljs
Thanks!
Can you eval (cider-debug-sesman-friendly-session-p)
within the same file? I'd need to inspect its output
Thanks!
Can you eval
(cider-debug-sesman-friendly-session-p)
within the same file? I'd need to inspect its output
"((\"/home/irrenwirr/dev/scittle/resources/public/cljs/nrepl_playground.cljs\" \"was not determined to belong to classpath:\" nil \"or classpath-roots:\" nil) (\"/home/irrenwirr/dev/scittle/resources/public/cljs/nrepl_playground.cljs\" \"was not determined to belong to classpath:\" nil \"or classpath-roots:\" nil))"
Perfect, that's the problem - the scittle runtime is returning an empty classpath. That foils our logic.
I think that there was a similar issue for bb or nbb and that it got fixed after some heads up.
I've pinged over Clojurians https://clojurians.slack.com/archives/C034FQN490E/p1719174846304749
In principle, scittle doesn't have the notion of a classpath, so there isn't a short-term fix.
You can sesman-link-with-buffer
instead. Then #3716 (comment) as well as your original issue should start working properly.
In principle, scittle doesn't have the notion of a classpath, so there isn't a short-term fix.
You can
sesman-link-with-buffer
instead. Then #3716 (comment) as well as your original issue should start working properly.
Nop, cider-connect-cljs
+ sesman-link-with-buffer still doesn't fix the issue on my end.
But simply using cider-connect-clj
(instead of -cljs
) works without issues, even while using clojurescript-mode. This one is a good workaround :)
Nice!
For this working session, what does (cider-debug-sesman-friendly-session-p)
return?
Nice!
For this working session, what does
(cider-debug-sesman-friendly-session-p)
return?
(("/home/irrenwirr/dev/scittle/resources/public/cljs/nrepl_playground.cljs" "was not determined to belong to classpath:" nil "or classpath-roots:" nil))
"((\"/home/irrenwirr/dev/scittle/resources/public/cljs/nrepl_playground.cljs\" \"was not determined to belong to classpath:\" nil \"or classpath-roots:\" nil))"
Thanks.
Happy that we documented a workaround and likely root cause.
I'll close the issue, but anyone interested could further investigate.