Fork me on GitHub
#cljsrn
<
2021-12-14
>
frankitox14:12:26

I just updated shadow-cljs and I can't connect to it from the phone, I've been using --config-merge '{:local-ip,"192.168.0.73"}' , but that doesn't seem to work anymore. Is it still possible to force an IP in some way in the config?

thheller17:12:01

@franquito if you updated to the latest version specifying a IP shouldn't be necessary at all anymore?

frankitox17:12:10

The thing is I'm using WSL2 in Windows to run the shadow server, and that runs in another network

thheller17:12:46

that shouldn't matter anymore

thheller17:12:15

hmm or I guess it might? can you try running shadow-cljs clj-repl

thheller17:12:46

and then (shadow/get-server-addrs)?

thheller17:12:23

that should contain a connectable IP? but I guess in WSL2 it might not contain one you can actually connect to?

frankitox17:12:44

Exactly! The phone is connected to other network

frankitox17:12:03

(the same that the Windows machine uses)

frankitox17:12:21

shadow.user=> (shadow/get-server-addrs)
("172.26.0.1" "172.18.247.215")

thheller17:12:41

hmm so which error do you get with and without config-merge?

frankitox17:12:46

☝️ those are addresses for the network shared by windows and WSL2

frankitox17:12:15

The error is the same, regardless of what I put on config-merge

frankitox17:12:17

Could not find shadow-cljs host address, tried 172.26.0.1,172.18.247.215

thheller17:12:44

hmmm that can't be right

thheller17:12:35

hmm dunno why config-merge doesn't trigger

frankitox17:12:42

The thing that puzzles me is you say forcing :local-ip should still work :thinking_face:

thheller17:12:07

but you can put {:local-ip "192.168.0.73"} in ~/.shadow-cljs/config.edn

thheller17:12:33

I changed the whole ip selection logic maybe I missed something about config-merge

thheller17:12:01

:local-ip is also supported directly in shadow-cljs.edn as well

thheller17:12:38

but ~/.shadow-cljs/config.edn is user specific so might be better fit if you work on stuff with multiple people

frankitox17:12:04

Oh, ok, let me check if it picks that one up

thheller17:12:54

https://github.com/thheller/shadow-cljs/issues/968 can't check right now but maybe later

👍 1
frankitox17:12:01

If :local-ip config is found, then it should appear in (shadow/get-server-addrs)?

thheller17:12:17

(shadow/get-configured-server-addr)

thheller17:12:43

but I think adding it will require a shadow-cljs restart

frankitox17:12:06

(shadow/get-configured-server-addr) that one returns the correct IP!

thheller17:12:52

then it should be used but as a I said it might only apply to the build after a restart

frankitox17:12:02

oh, using ~/.shadow-cljs/config.edn works

thheller17:12:36

but that being said forcing one should still work just fine in that way