Fork me on GitHub
#figwheel-main
<
2020-07-08
>
bhauman17:07:16

Support for react native just landed in 0.2.10-SNAPSHOT

Michaël Salihi21:07:11

@bhauman I'm testing the new React native docs/feature, thank you for this! Great work as usual ! 🙂

Michaël Salihi21:07:08

First launch give me a missing create-react-class package error. It seems the last create-react-native doesn't provide this package anymore and react-native-figwheel-bridge use it, so I do npm install create-react-app.

Michaël Salihi21:07:24

After that, I run this error on Android emulator (I haven't tested on real devices).

[Wed Jul 08 2020 23:23:37.936]  ERROR    Unable to fetch optionsUrl 
[Wed Jul 08 2020 23:23:38.542]  WARN     Possible Unhandled Promise Rejection (id: 0):
TypeError: undefined is not an object (evaluating 'config.evaluate')

bhauman21:07:05

@admin055 OK interesting!

bhauman21:07:09

@admin055 how did you create the application?

bhauman21:07:56

I would do a npm install create-react-class not npm install create-react-app

bhauman21:07:36

OK I think I found the bug you are running into

bhauman21:07:56

its interesting because you are on a different platform

Michaël Salihi21:07:15

> I would do a npm install create-react-class not npm install create-react-app Right, it's what i'm doing 🙂 My mistake, only a typo

bhauman21:07:30

gotcha thats’ what I thought

bhauman21:07:00

@admin055 so in your output-dir + “_rn” there is a clojurescript-bootstrap.js file

bhauman21:07:23

line 31 is where the error is being thrown

bhauman21:07:40

if you change that to var evaluate = config["evaluate"] || eval;

bhauman21:07:16

you should be in business

bhauman21:07:51

but don’t re-run figwheel, just see if the react-android builder starts

bhauman21:07:49

Also this is a good point that I should stop using create-react-class and just use react-hooks

đź‘Ť 3
bhauman21:07:35

or wait just have a class as its going through the transpiler

Michaël Salihi21:07:40

> if you change that to     var evaluate = config["evaluate"] || eval; Again "undefined" :

TypeError: undefined is not an object (evaluating 'config["evaluate"]')

bhauman21:07:59

oh so no config is nil

bhauman21:07:56

oh that’s because of the first error its not finding the cljsc_opt.json file

bhauman21:07:32

@admin055 is that file there in your output-dir?

bhauman21:07:46

cljs-out/android/cljsc_opts.json

bhauman21:07:05

or at this url

Michaël Salihi21:07:55

Yes, the file exists

Michaël Salihi22:07:00

After uninstall the app and relaunch the builder, no more error but blank page in app. It's late, I'll retry tomorrow. Thx for the support!

bhauman22:07:07

cool hit me up tomorrow, sounds like a race condition where the server hasn’t started

bhauman22:07:18

so it can’t find the file

bhauman22:07:54

Thanks for trying this out @admin055 I really need this early feedback to work out the last bugs. Sorry I didn’t try this with android. It’s such a large setup time.

đź‘Ť 3