Fork me on GitHub
#clojurescript
<
2021-12-14
>
Jakub Holý (HolyJak)13:12:03

Hi! Has anyone got GitPod working with shadow-cljs to be able to eval cljs code in the repl? (I fail with "No available JS runtime." so it seems the repl is not connected properly though, even though Calva output reads "Connected session: cljs, repl: :todomvc")

thheller17:12:47

@holyjak Calva is connecting to your shadow-cljs instance server side. did you open the build in the browser as well? that is the runtime which also needs to connect

Jakub Holý (HolyJak)18:12:14

I suspect I might need to open the nrepl per publicly or /and tell shadow to listen on 0.0.0.0 instead of 127...

thheller18:12:31

it listens on 0.0.0.0:9630 by default

thheller18:12:04

never used gitpod myself so no clue what their network/firewall setup looks like

thheller19:12:37

what does the browser console say? I mean that should be complaining if the websocket can't connect

Jakub Holý (HolyJak)22:12:40

it does not mention shadow as far as I can see

Jakub Holý (HolyJak)22:12:19

Found it! How to fix > Error: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS. > at shadow$cljs$devtools$client$websocket$start (/js/cljs-runtime/shadow.cljs.devtools.client.websocket.js:4) ? (GitPod generates address such as https://8181-yellow-whale-bcyy99oq.ws-eu23.gitpod.io for the app) It is trying to connect to <ws://8181-yellow-whale-bcyy99oq.ws-eu23.gitpod.io:9630/api/remote-relay?server-token=d067c920-5712-4e5c-ac73-cfd0a0bff251> while I need it to use wss and a different domain, It is also possible websockets are not supported by gitpod, have to figure that out