Fork me on GitHub
#shadow-cljs
<
2020-08-12
>
robert-stuttaford09:08:14

howdy @thheller! i see this issue is closed: https://github.com/thheller/shadow-cljs/issues/716 did this get fixed and i just need a newer version?

thheller10:08:18

I think so but nobody has ever confirmed so no clue actually. I don't use emacs/cider myself and don't have a clue how to test this 😛

robert-stuttaford10:08:22

ok, pretty sure it isn't working, but i'll test with the very latest version to be sure 🙂

ramblurr10:08:00

I am attempting to use the cljs library https://github.com/lifecheq/re-auth0 which wraps the https://github.com/auth0/auth0.js/ library. re-auth0 uses the old cljsjs method of including deps. I followed the instructions https://code.thheller.com/blog/shadow-cljs/2017/11/10/js-dependencies-in-practice.html#migrating-cljsjs by creating a shim. However when shadowcljs runs it complains The required JS dependency "process" is not available, it was required by "node_modules/auth0-js/dist/auth0.min.js" According to https://github.com/thheller/shadow-cljs/issues/519#issuecomment-508386654 this should be remediated by ensuring shadow-cljs is an app dependency... but it already is in my project (generated with luminus), or so I thought? The line in :dependencies in project.clj is [thheller/shadow-cljs "2.10.17" :scope "provided"]

thheller10:08:46

@ramblurr you need to have the npm shadow-cljs installed in your project. so npm install shadow-cljs. that brings in the required process polyfill.

ramblurr10:08:01

Oh the npm module !

ramblurr10:08:36

thanks @thheller that does it, I added a comment to the linked issue mentioning the distinction

me167613:08:59

Just switched a pretty old node bundle to shadow-cljs and everything works like a charm. Love having a reliable REPL. Thanks @thheller!

rickheere20:08:39

Hi everyone, I hope someone can point me in the right direction. I downloaded the react native expo reagent repo. Them I test it on my phone the app loads as expected but in about 5 to 10 seconds I get this error.

rickheere20:08:49

Running application "main" with appParams: {"initialProps":{"exp":{"lastErrors":[{"isFatal":false,"errorMessage":"console.error: \"shadow-cljs - remote-error\", [object Object]","exceptionId":2},{"isFatal":false,"errorMessage":"console.error: \"shadow-cljs - remote-error\", [object Object]","exceptionId":3},{"isFatal":false,"errorMessage":"console.error: \"shadow-cljs - remote-error\", [object Object]","exceptionId":3}],"initialUri":"","manifest":{"env":{},"id":"@anonymous/reagent-expo-f0486819-2cb9-4ab2-ae63-272afd37af81","privacy":"public","assetBundlePatterns":["**/*"],"primaryColor":"#023C69","bundleUrl":"","slug":"reagent-expo","name":"hello-world","icon":"./assets/icon.png","xde":true,"loadedFromCache":false,"splash":{"resizeMode":"contain","backgroundColor":"#ffffff","image":"./assets/splash.png","imageUrl":""},"orientation":"portrait","entryPoint":"./app/index.js","iconUrl":"","isVerified":true,"version":"1.0.0","developer":{"tool":"expo-cli","projectRoot":"/home/rick/Repositories/dca3"},"mainModuleName":"app/index","debuggerHost":"192.168.2.36:19001","logUrl":"","packagerOpts":{"https":false,"dev":true,"lanType":"ip","hostType":"lan","minify":false,"urlRandomness":"84-n8h"},"sdkVersion":"35.0.0","platforms":["ios","android","web"],"hostUri":"192.168.2.36:19000","ios":{"supportsTablet":true},"updates":{"fallbackToCacheTimeout":0}},"shell":false}},"rootTag":81}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF

rickheere20:08:54

some more info

thheller20:08:03

@rickheere I suspect that its picking the wrong IP to connect to. try running shadow-cljs clj-repl and then (shadow/get-server-addr)

rickheere20:08:33

If I connect the devtools I also get the message a bit more info Failed to connect to localhost/127.0.0.1:9630

rickheere20:08:38

shadow.user=> (shadow/get-server-addr)
"172.19.0.1"

thheller20:08:58

hmm yeah thats the wrong one I guess

thheller20:08:06

you can try :local-ip "192.168.2.36" in the build config or shadow-cljs watch app -config-merge '{:local-ip "192.168.2.36"}'

adam67820:08:38

Live reloading works but the lifecycle hooks (:after-load, :before-load) are not being called, it even logs explicitly that there is no :after-load hook. I've tried both via metadata and in :devtools. Could there be a sane reason?

thheller20:08:21

its :dev/after-load in the code? the namespace needs to be actually included in the build too? maybe via :preloads if its not part of your usual code?

rickheere20:08:54

I can confirm that adding :local-ip "192.168.2.36" worked for me.

thheller20:08:34

@rickheere can you share (shadow/find-local-addrs) from the CLJ repl?

thheller20:08:24

maybe I can adjust the filtering so it finds the correct one on its own

rickheere20:08:15

shadow.user=> (shadow/find-local-addrs)
Syntax error compiling at (REPL:0:0).
Unable to resolve symbol: f in this context
([#object[java.net.NetworkInterface 0x7d151d89 "name:br-c8e7b746556e (br-c8e7b746556e)"] #object[java.net.Inet4Address 0x789f27e5 "/172.19.0.1"]] [#object[java.net.NetworkInterface 0x1dea0730 "name:wlp2s0 (wlp2s0)"] #object[java.net.Inet4Address 0x7dfe23c2 "/192.168.2.36"]])

rickheere20:08:38

Is this what you are looking for?

thheller20:08:06

yes, thx. had hoped for a more recognizable pattern or so. doesn't look like something I can easily filter.

rickheere21:08:55

To bad, thank you for the help.