Fork me on GitHub
thheller09:02:45 saw your question on twitter. did you sort it out?


Nope not yet. :)


Let me get some more details...


I'm behind a corporate HTTP proxy currently, if I specify proxy details as follows in my projects local shadow-cljs.edn it works fine:


I assume by proxy you meant the :proxy in shadow-cljs.edn for dependency resoltiuon?



 :proxy {:host "" :port 3128}
 :nrepl {:port 9000}

 [[cider/cider-nrepl "0.25.8"]
  [reagent "1.0.0"]
  [re-frame "1.1.2"]]

 :builds {:app {:target     :browser
                :output-dir "public/js"
                :modules    {:main {:entries []}}
                :devtools   {:http-root "public"
                             :http-port 3000}}

          :prod {:target     :browser
                 :output-dir "public/js"
                 :modules    {:main {:entries []}}
                 :release    {:compiler-options {:optimizations :simple}}}}}


yeah that should be :maven {:proxy ...}


that'll then work in the other config too


nice! 🙂


Thanks for the help!


btw the :prod build is an anti-pattern in shadow-cljs


just put the :release bit into the :app config


optimizations are only applied to release builds so it does not affect the watch or compile builds


Ah got you! Thanks for the spot.


Learnt something new 🙂


yeah common mistake people make that have used other tools before (or read other docs) 🙂

👍 1

Would you then just do shadow-cljs release app ?


The proxy still doesn't seem to work globally set.


This is what I have set:


{:mvn {:proxy {:host "" :port 3128}}}


file-path is: /home/rameezk/.shadow-cljs/config.edn


:maven not :mvn


That look right?


Apologies, that works 🙂

👍 1

please give me a hint with regards to missing source maps e.g. DevTools failed to load SourceMap: Could not parse content for : Unexpected token < in JSON at position 0 the < part is because the static server returns the index.html, but the file is missing too. I am not even sure if the file should or shouldn't exist and I don't need the source maps right now at all, but I suspect I am doing something wrong again and that's why I have these warnings


my guess is you have :asset-path "/" but the files aren't actually located there. it should match the path you use to serve the JS. so maybe /js or so


that was it, thank you


funny thing is, i did check the files by name before and i saw some source map files, but not exactly the one i was checking and i concluded it must be something else, not just a path issue


Hi. I am having problems with hot reload. I ran shadow-cljs watch app --verbose and found that it was using a different IP address than expo. How can I get them to be the same?


I still need a better place to configure this somehow 😛

Jaime Sangcap23:02:08

Hi, I'm trying to run cljs-test in repl in my react-native project. But I'm getting this error when the app loads in the emulator EDIT: error has changed

[Wed Feb 03 2021 03:48:56.126]  WARN     The shadow-cljs Websocket was disconnected.
[Wed Feb 03 2021 03:48:56.127]  ERROR    shadow-cljs - remote-error {"isTrusted": false, "message": "failed to connect to / (port 9630) from / (port 36722) after 10000ms"}
Now when I send forms to repl, I got this error
No available JS runtime.


I’m adding `{:closure-defines {"shadow.cljs.devtools.client.env.server_host" "%IP-ADDRESS%"}}` to `(shadow/watch options)` to set correct IP address


what the heck does this do? is this some kind of trick I don't know about? what is %IP-ADDRESS%? or do you just set the actual IP there?

Jaime Sangcap20:02:32

Hi @U051091NM, how can I get the IP address? Is it the IP of the emulator? I don't know how to get the IP


%IP-ADDRESS% is a placeholder for your machine real ip


{:closure-defines {"shadow.cljs.devtools.client.env.server_host" ""} for instance


@thheller server_host is used here if not set, it uses “localhost” which doesn’t work in iOS simulator (it needs ip address to connect)


@UNL0HK5ME It needs to be IP address of your host machine (where shadow-cljs is running), on mac you can get it with ipconfig getifaddr en0 where en0 is your network interface


@U051091NM well for react-native there is :local-ip "" in your build config or via config merge. going through closure-defines is kinda backwards. just thought there was some magic %IP-ADDRESS% placeholder or something that metro will replace but I guess not.


Thanks @thheller Nice to know there is local-ip option. At the time i was adding hack with server-port override, it wasn’t there i think.


that has always been there, just not documented. I don't do react-native myself so the entire section of the code and docs is lacking a lot of clarity 😞

Jaime Sangcap16:02:41

@U051091NM thanks! I will try that one. The whole time I'm thinking shadow and emulator are running in localhost. I want to dig more into the architecture, do you have recommended resources that I can read?

Jaime Sangcap17:02:48

Thanks! it works now by specifying the LAN IP. If I understand correctly now, my laptop running the shadow-cljs and emulator will be two device connected to the LAN. When shadow-cljs runs in localhost, the websocket client running in the emulator tries to connect to localhost which is then the emulator not my laptop? Where the solution to put the specific IP will make the websocket client point to my laptop LAN IP which is where the websocket server is running right?


Yes, client running in the emulator needs IP to connect to server which is running on your laptop


technically it doesn't use localhost by default for react-native. it uses the IP it gets from your system. specifically this part of the code


but if your machine has multiple IPs it sometimes picks the incorrect one. still need to tune that mechanism a little I guess.


but yes, your emulator has a different IP and connects over the "network" not localhost

Jaime Sangcap18:02:46

Thanks @thheller @U051091NM for these pointers. I learned something new again