Fork me on GitHub
#clojure
<
2021-04-19
>
emccue13:04:43

Using https://github.com/cognitect/transit-js with webpack and getting this at runtime

emccue13:04:46

TypeError: goog.isArray is not a function. (In 'goog.isArray(a)', 'goog.isArray' is undefined)

This error is located at:
    in App (created by ExpoRoot)
    in ExpoRoot (at renderApplication.js:45)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:106)
    in DevAppContainer (at AppContainer.js:121)
    in RCTView (at View.js:34)
    in View (at AppContainer.js:132)
    in AppContainer (at renderApplication.js:39)
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog

emccue13:04:40

so, their build is broken?

borkdude13:04:07

@U3JH98J4R I made a mention of this now in #cljs-dev

p-himik13:04:03

@U3JH98J4R Seems like goog.isArray is only used by the printing function. Are you [implicitly] calling toString on the read value?

emccue13:04:21

I am explicitly calling toString

emccue13:04:52

(val.status == 'success') ? <Text> {val.data.toString()} </Text> ...

p-himik13:04:20

Four ways to fix it in your build: 1. Wait till it's fixed in transit-js 2. Use an older version of ClojureScript 3. Patch the goog object (might be finicky in the release build) 4. Roll out your own implementation of toString

borkdude13:04:27

@U3JH98J4R a workaround for now would be to downgrade CLJS to the previous release, file an issue at transit-js. wait for them to bump it to the newest closure and then upgrade again

emccue13:04:32

I'm not using clojurescript

emccue13:04:53

i just am using the npm dep, which says it has no dependencies

borkdude13:04:04

oh, hmm. then use an older version of closure explicitly

emccue13:04:17

closure isn't in the dependencies

emccue13:04:26

so pick an older released build from them?

borkdude13:04:21

I have no idea how this works, but perhaps ask in #clojurescript

emccue13:04:23

Works if I downgrade to 0.8.861 from 0.8.867

emccue13:04:50

so confidence in library has gone from an 8 to around a 3

p-himik13:04:04

FWIW their issues on GitHub are open - you can create an issue there, it might get better traction.

emccue13:04:43

wasn't getting any error until it tries to actually parse data