Fork me on GitHub
#shadow-cljs
<
2021-08-15
>
Ronny Li03:08:06

Hi everyone, I'm new to using the REPL so I just wanted to check if I'm doing everything correctly. I've got shadow-cljs and cursive so I followed https://gist.github.com/akovantsev/44e2a0e10908785d1f40d3d3bcfff574. I connect to the REPL just fine but it doesn't seem to be linked to my app. When I run (js/alert "foo") I don't see anything in the browser and doing @(rf/subscribe [:bar]) returns nil when I would expect it to contain values from the app-db. Any help would be appreciated!

thheller06:08:10

@ronny463 check http://localhost:9630/runtimes. it should list your runtimes connected. there should be at least 2. how many do you have?

Ronny Li13:08:30

Hi Thomas, thanks for your help. I have 4 runtimes connected.

thheller06:08:36

sorry so you have 2 runtimes for the :dev build. the REPL picks the one that connects first and evals there

thheller06:08:22

btw :dev builds are an anti pattern in shadow-cljs. builds always represent the dev and release parts in one config

thheller06:08:44

don't know why you have two runtimes though. do you load the code in an iframe or so?

Ronny Li00:08:11

Hi Thomas, thank you for your help. I had two windows open for localhost and my REPL was connected to the second one. Everything behaves as expected now 🙂

Ronny Li00:08:05

Also thank you for letting me know that the dev build is an anti-pattern. Going forward I'll rename :dev to :app