See
- https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive
- https://andrearichiardi.com/blog/posts/clojurescript-cursive-shadow-setup.html
- in shadow-cljs.edn:
,,,
:builds {:my-build-id {:output-dir "target/"
:asset-path "."
:target :browser
,,,
- in terminal:
yarn shadow-cljs watch app
this will:
shadow-cljs - starting via "clojure"
shadow-cljs - HTTP server available at http://localhost:8080
shadow-cljs - server version: 2.8.31 running at http://localhost:9630
shadow-cljs - nREPL server started on port 59334
shadow-cljs - watching build :my-build-id
where :my-build-id
is the name I gave to build. Pick your own.
-
open browser tab looking at
http://localhost:8080
from shadow output above. -
in cursive:
Run -> Run... -> Edit Configurations... -> + -> Clojure REPL -> Remote
- give it a name, eg.
my cljs repl
- fillout
connect to server
with nrepl port59334
from shadow output above. Or, optionally, in newer Cursive, selectuse port from nrepl file
option instead of hardcoding it. - select something in
context module
. - click
apply
-
in cursive: run
my cljs repl
-
DO NOT change
clj
tocljs
in REPL dropdown -
in REPL eval:
(shadow/repl :my-build-id)
this will change clj
to cljs
in REPL dropdown.
-
Done. Now you can send forms from your
cljs
andcljc
files to the REPL. -
This REPL error:
No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code.
means you browser tab is not connected to shadow's REPL.
To fix it, do this again:
1. open browser tab looking at `http://localhost:8080` from shadow output above.