Fork me on GitHub
#shadow-cljs
<
2019-06-26
>
aaron5103:06:22

Running a react-native shadow-cljs build in Docker, and devtools on the phone is trying to connect to a ws:// URL that’s only accessible inside the Docker container (`<ws://169.254.32.96:9630/ws/...`>). Related line in react-native.cljs - https://github.com/thheller/shadow-cljs/blob/89acb664f800af48344288e963873bf8972ee9fb/src/main/shadow/cljs/devtools/client/react_native.cljs#L206 The ws connect fails so the app crashes with the React Native red screen every 30 seconds. Related GH issue? https://github.com/thheller/shadow-cljs/issues/482 Are there any workarounds? Can we specify the websocket hostname in shadow-cljs.edn?

thheller08:06:35

@aaron51 you can currently configure the ip/host to connect to via shadow-cljs watch app --config-merge '{:local-ip "1.2.3.4"}' or just the :local-ip in the build config itself

thheller08:06:48

should work if you give it a hostname

orestis10:06:46

I am having some weird issue — did something change recently? ["react" :as React] now returns an empty javascript object, and I get cascading failures about how .createContext etc is not a function.

orestis10:06:32

Trying to roll back some dependency upgrades to see if something in my package.json is playing up.

thheller11:06:40

try restarting shadow-cljs

thheller11:06:51

sometimes the cache gets confused if you mess with node_modules files too much

orestis12:06:53

Turns out I can reproduce this after doing a release build, followed by a dev build. The dev build then breaks. Removing .shadow-cljs fixes it. I can reproduce this 100% of the time.

thheller11:06:07

but no nothing changed in that regard

orestis11:06:16

I’ve done numerous times — I’ll try once more 🙂

thheller11:06:28

make sure you are actually restarting the server instance

thheller11:06:53

if it says connected to server on startup you did not restart the server isntance just the watch

orestis11:06:09

Good point — yes, I am — I’m also nuking node_modules and .shadow_cljs (but I’m keeping a copy around 😉 )

Nolan11:06:42

updated shadow-cljs version, and i had to add proxy in shadow-cljs.edn at root of project directory

Nolan11:06:11

in the previous version, shadow-cljs read the proxy from ~/.shadow-cljs/config.edn

thheller11:06:29

I assume you mean maven proxy?

thheller11:06:47

those settings were moved to :maven {:proxy ...} in ~/.shadow-cljs/config.edn

Nolan11:06:19

sorry yeah, my config is

{:maven
 {:proxy
  {:host "localhost"
   :port 8099}}}

Nolan11:06:59

sorry, false alarm, i was using the global install of shadow-cljs which was on an older version

orestis12:06:31

Turns out that doing a blind npm update is dangerous. Something somewhere broke everything. Manually editing the package.json versions to the same numbers fixes the issue.

Olical14:06:21

flash backs to when I was a full time JS dev I love that whatever is in my project.clj or deps.edn is what I'll get. No ambiguity. The whole ^2.1.3 automatic bumping thing scared the living daylights out of me.

orestis16:06:38

Is yarn any better at this?

Olical16:06:23

Not as I recall, no. It's more of a cultural problem than a software one I think? Well, I see it as a problem personally. I think lockfiles help but things can still bump mysteriously in transitive things?

orestis18:06:59

Just had a read - npm install does bump non-fixed transitive dependencies, and then updates your lock file... but npm ci does not. Yarn has more same defaults.

orestis12:06:23

Or it was just a combination of cache issues?