shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
benny 2020-12-04T06:42:09.345500Z

i tend to end up with errors like this in my release builds for our react native project. does this have to do with the :infer-externs flag?

E/unknown:ReactNative: MyAppImpl caught native exception
    com.facebook.react.common.JavascriptException: TypeError: u(BY).Il is not a function. (In 'u(BY).Il(q.a(n))', 'u(BY).Il' is undefined), stack:

thheller 2020-12-04T08:58:31.346100Z

@benny yes, thats a typical externs error

defa 2020-12-04T09:36:09.347300Z

With :target :react-native where would I put files to load on demand via (js/require "data.json")? Is there some assets/resource path to configure?

thheller 2020-12-04T12:06:36.348200Z

in shadow-cljs no, in react-native I don't know. just js/require the file with a relative path to the output file

rkiouak 2020-12-04T12:36:39.349600Z

I imagine with react native it would be similar to how fonts are bundled -- so i think something in both ios and android folders

benny 2020-12-04T20:30:04.349700Z

is the solution for it to just change :infer-externs to false!?

thheller 2020-12-04T21:55:18.349900Z

the solution is add ^js typehints where required. :infer-externs false just turns of the warnings. see https://shadow-cljs.github.io/docs/UsersGuide.html#infer-externs