Fork me on GitHub
#shadow-cljs
<
2021-04-28
>
mbertheau05:04:03

Is there a quicker way to get a react-native app to try to reconnect to the shadow-cljs server after it lost that connection (for example wifi reconnect) than re-starting the app with react-native run-android ?

henryw37406:04:13

hi. is there a way to depend on a cljs library which depends on npm libs, but tell shadow to not include the npm source in the build? or to put it another way, put :exclusions on npm-deps ? I see the bit about cdn and resolve-global here: https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve-global which would be handy if I could do the exclusions

thheller06:04:58

@henryw374 :js-options {:resolve {"npm-dep" false}} will "ignore" the dependency but fail if you actually attempt to use it in the code

thheller06:04:01

:npm-deps {:install false} in the shadow-cljs.edn root will not attempt to install npm-deps from deps.cljs at all, there are no specific exclusions otherwise

Aron17:04:48

I have a weird error that does this https://imgur.com/a/AuzL5iy and I am not sure how I could go about finding out where it is coming from.

Aron17:04:52

It's in development

thheller17:04:42

@ashnur looks like trying to print a self-referential structure of some kind. an atom that contains itself or so

Aron17:04:04

can I assume it has to be a prn? I don't use anything else that prints in my own code

thheller17:04:11

could also be a str call, but more likely prn or pr-str yes

Aron17:04:26

I have much much more str than prn 🙂 Thanks, I should be able to find it

Aron19:04:36

Probably not prn, because I have them all commented out. It's particularly bad because I can't consistently reproduce it, it always appears when I least expect it. I am writing here because when it happens, the first sign is that shadow-cljs notification appears saying "reconnecting".

thheller19:04:51

I don't have the slightest clue what you are actually doing so I can't really comment. only you know how your data is structured and where it is sent. might not be your code, might be some library you use that tries to send data as EDN

Aron19:04:45

fair, I didn't expect miracles, only if you or others saw something similar then I might've been lucky : )

Aron19:04:23

I am betting on some react issue

thheller19:04:30

(def x (atom {:x nil})) -> (swap! x assoc :x x) ->

The result object failed to print. It is available via *1 if you want to interact with it.
The exception was:
RangeError: Maximum call stack size exceeded
:repl/print-error!

thheller19:04:02

fairly simple to replicate the issue from the REPL, just gotta find it. might just be a missing deref somewhere

Aron19:04:16

I don't have any atoms :-S

thheller20:04:56

doesn't have to be an atom, just an example. ANY structure that can reference itself will have this issue

thheller20:04:28

(def x #js {:x nil})
#'cljs.user/x
cljs.user=> x
#js {:x nil}
cljs.user=> (set! (.-x x) x)
The result object failed to print. It is available via *1 if you want to interact with it.
The exception was:
RangeError: Maximum call stack size exceeded
:repl/print-error!

Aron20:04:26

Thanks for the elaboration on that, I am familiar with the js version of this (e.g. when json fails for circular references), with this knowledge I will be able to find it for sure.