Jo Ko
Jo Ko

Reputation: 7575

Why 'Unable to execute JS call: __fbBatchedBirdge is undefined in React native?

I pulled a React Native project from github and attempted to do react-native run-ios but I got the following error:

enter image description here

What could be causing this problem?

Thank you

Upvotes: 0

Views: 1031

Answers (1)

FuzzyTree
FuzzyTree

Reputation: 32392

In RN versions < .30 this error sometimes comes up when you try to run the app in development/debug mode in xcode but use the release jsLocation line in AppDelegate.m (i.e. the offline bundle).

The solution is to use the development jsLocation and comment out the prod jsLocation or just upgrade RN to a version >= .30 where you no longer have to manually specify the dev/release jsLocation.

RN version < 0.30 - AppDelegate.m

Comment this line

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

Uncomment this line

jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];

Upvotes: 3

Related Questions