cljsrn

frankitox 2021-12-14T14:27:26.088Z

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?

thheller 2021-12-14T17:10:01.088600Z

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

frankitox 2021-12-14T17:11:10.089100Z

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

thheller 2021-12-14T17:11:46.089400Z

that shouldn't matter anymore

thheller 2021-12-14T17:12:15.089600Z

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

frankitox 2021-12-14T17:12:36.089800Z

Yes

thheller 2021-12-14T17:12:46.090Z

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

thheller 2021-12-14T17:13:23.090200Z

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

frankitox 2021-12-14T17:13:44.090400Z

Exactly! The phone is connected to other network

frankitox 2021-12-14T17:14:03.090600Z

(the same that the Windows machine uses)

frankitox 2021-12-14T17:14:21.090800Z

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

thheller 2021-12-14T17:14:41.091Z

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

frankitox 2021-12-14T17:14:46.091200Z

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

frankitox 2021-12-14T17:15:15.091400Z

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

frankitox 2021-12-14T17:15:17.091600Z

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

thheller 2021-12-14T17:15:44.091800Z

hmmm that can't be right

thheller 2021-12-14T17:16:35.092Z

hmm dunno why config-merge doesn't trigger

frankitox 2021-12-14T17:16:42.092200Z

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

frankitox 2021-12-14T17:16:48.092400Z

right

thheller 2021-12-14T17:17:07.092600Z

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

thheller 2021-12-14T17:17:33.092800Z

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

thheller 2021-12-14T17:18:01.093Z

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

thheller 2021-12-14T17:18:38.093200Z

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

frankitox 2021-12-14T17:19:04.093400Z

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

frankitox 2021-12-14T17:19:06.093600Z

thanks!

thheller 2021-12-14T17:19:54.093800Z

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

👍 1
frankitox 2021-12-14T17:21:01.094100Z

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

thheller 2021-12-14T17:21:17.094400Z

(shadow/get-configured-server-addr)

thheller 2021-12-14T17:21:43.094700Z

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

frankitox 2021-12-14T17:25:06.094900Z

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

thheller 2021-12-14T17:27:52.095100Z

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

frankitox 2021-12-14T17:34:02.095300Z

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

thheller 2021-12-14T17:10:36.089Z

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