This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-02
Channels
- # announcements (13)
- # architecture (18)
- # babashka (90)
- # beginners (80)
- # calva (35)
- # chlorine-clover (29)
- # cider (24)
- # clj-kondo (4)
- # cljfx (3)
- # clojure (60)
- # clojure-australia (2)
- # clojure-europe (60)
- # clojure-france (2)
- # clojure-germany (3)
- # clojure-italy (4)
- # clojure-nl (84)
- # clojure-norway (7)
- # clojure-uk (53)
- # clojurescript (54)
- # clojureverse-ops (1)
- # community-development (6)
- # conjure (1)
- # contributions-welcome (1)
- # cursive (12)
- # datomic (1)
- # fulcro (16)
- # garden (61)
- # girouette (1)
- # graalvm (14)
- # hugsql (1)
- # instaparse (5)
- # jobs-discuss (11)
- # keechma (1)
- # lambdaisland (3)
- # off-topic (20)
- # pathom (1)
- # re-frame (3)
- # reitit (2)
- # releases (1)
- # remote-jobs (2)
- # reveal (11)
- # shadow-cljs (58)
- # spacemacs (5)
- # sql (3)
- # startup-in-a-month (1)
- # vim (2)
@rameezkhan.sa saw your question on twitter. did you sort it out?
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?
{:source-paths
["src"]
:proxy {:host "127.0.0.1" :port 3128}
:nrepl {:port 9000}
:dependencies
[[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}}}}}
optimizations are only applied to release
builds so it does not affect the watch
or compile
builds
yeah common mistake people make that have used other tools before (or read other docs) š
please give me a hint with regards to missing source maps e.g. DevTools failed to load SourceMap: Could not parse content for
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
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?
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 /10.212.134.22 (port 9630) from /10.0.2.16 (port 36722) after 10000ms"}
Now when I send forms to repl, I got this error
No available JS runtime.
See
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?
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
{:closure-defines {"shadow.cljs.devtools.client.env.server_host" "192.168.1.111"}
for instance
@thheller server_host
is used here https://github.com/thheller/shadow-cljs/blob/3e559b8f9ea80cc1ad1c51772fe4aa8c099a1159/src/main/shadow/cljs/devtools/client/env.cljs#L84 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 "1.2.3.4"
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 š
@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?
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
Thanks @thheller @U051091NM for these pointers. I learned something new again