This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-04
Channels
- # announcements (30)
- # aws (7)
- # babashka (7)
- # beginners (64)
- # calva (39)
- # cherry (17)
- # cider (1)
- # clj-on-windows (6)
- # clojure (30)
- # clojure-austin (12)
- # clojure-europe (25)
- # clojure-nl (2)
- # clojure-norway (23)
- # clojure-spec (23)
- # clojure-uk (6)
- # clojurescript (20)
- # cursive (18)
- # datahike (3)
- # datalevin (12)
- # datomic (9)
- # etaoin (5)
- # graalvm (45)
- # instaparse (2)
- # interceptors (11)
- # kaocha (1)
- # lsp (102)
- # meander (6)
- # nbb (16)
- # off-topic (30)
- # pathom (83)
- # pedestal (6)
- # portal (5)
- # re-frame (12)
- # reitit (5)
- # rewrite-clj (10)
- # scittle (35)
- # shadow-cljs (49)
- # spacemacs (10)
- # vim (14)
Howdy all,
I'm struggling to set-up a working browser repl with shadow-cljs. My app has a nrepl connection on port 3333.
Here's my workflow:
1. Open nrepl prompt , '
2. Select cider-connect-cljs
3. Select localhost
4. Select my-app:3333
5. Select shadow
from the nrepl list
The *Messages*
buffer states [nREPL] Direct connection to localhost:3333 established
.
However, evaluating the core.cljs
buffer hangs indefinitely on Loading /my-app/src/app/core.cljs...
and evaluating a function e.g (js/alert "hello")
has no effect in the browser.
Is your project public? I can diagnose it faster looking at it.
How are you injecting the nrepl middleware/code/libraries/deps into your app so that cider can connect to it?
Finally, assuming you did that right (see https://shadow-cljs.github.io/docs/UsersGuide.html#cider)
I sometimes have to go to the shadow cljs browser tab that has the server info and force a compile, then browser app before it will let me eval something.
The repo's not yet public, I'm afraid.
RE: nrepl injection method, how would I go about determining that?
I'll go ahead an include the shadow-cljs.edn
on the off chance that helps:
{:builds
{:app {:asset-path "/js"
:modules {:main {:init-fn app.core/main}}
:output-dir "public/js"
:target :browser}
:cards {:asset-path "/js"
:modules {:main {:init-fn app.cards/main}}
:compiler-options {:devcards true}
:output-dir "public/js"
:target :browser}
:test {:ns-regexp "app.cards"
:output-to "out/test.js"
:target :node-test}
:e2e {:ns-regexp "e2e.*"
:output-to "out/e2e.js"
:target :node-test}}
:dependencies [[reagent "0.8.1"]
[devcards "0.2.6"]]
:dev-http {4200 "public"}
:nrepl {:port 3333}
:source-paths ["src"]}
Check the links above as well as reading the cider docs about shadow, that's a good starting point for understanding. But when you start shadow it needs a cider client lib. Cider Jack in, will add it for you. If you connect, then you have to add it. No way is better, but if emacs/cider adds it for you then the client lib will sync with the server.
Yeah. After reading that once, feel free to ask again. It's not easy.