react-native: Unable to execute JS call: __fbBatchedBridge is undefined

Hi guys,

I believe a similar sounding bug has already made it here some time ago (just searching the issue tracker).

The message in the Xcode console is

2016-03-03 22:49:51.428 [warn][tid:main][RCTDevMenu.m:323] RCTSourceCode module scriptURL has not been set
2016-03-03 22:49:51.432 [fatal][tid:com.facebook.React.JavaScript] Unable to execute JS call: __fbBatchedBridge is undefined

Steps to reproduce (using “react-native”: “^0.21.0”)

  1. Execute react-native init AwesomeProject
  2. open AwesomeProject.xcodeproj in Xcode
  3. edit AppDelegate.m, uncomment jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
  4. Product -> Run

I’m just trying to follow the docs from here https://facebook.github.io/react-native/docs/running-on-device-ios.html#using-offline-bundle maybe I’m misunderstanding something.

I also tried generate the main.jsbundle file with react-native bundle --entry-file ./index.ios.js --platform ios --bundle-output ios/main.jsbundle but the same error happens when clicking Run

Thanks for all your work on React native, it’s really fantastic!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 33 (7 by maintainers)

Most upvoted comments

Same code need to comment in node_modules/react-native/packager/react-native-xcode.sh

if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then echo "Skipping bundling for Simulator platform" exit 0; fi

0.46 keep constantly getting this error.

I’m on the latest version 0.43 and still getting this issue? 😦

Same here. Every time when I do Remote JS Debugging, I get this error on my iOS simulator. If I do not do Debugging, it is fine.

Occurring on 0.40.0

That fixed for me, thanks @shahchirag and @grabbou

in node_modules/react-native/packager/packager.sh

Replace

    if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then     
      echo "Skipping bundling for Simulator platform"       
      exit 0;       
    fi

with

#    if [[ "$PLATFORM_NAME" = "iphonesimulator" ]]; then        
#      echo "Skipping bundling for Simulator platform"      
#      exit 0;      
#    fi

Out of curiosity, and largely as a digression to this issue, is this a bug? Or is it due to xcode/simulator?

Additionally, i’m guessing not everybody is dependent on the xcode-heavy workflow that i go through, but how else does one upload the Archived version of the code to testflight and alike?

I am getting this issue no 0.41 as well! Commenting out fix doesn’t work… Any ideas?

Hey,

Can you try commenting out the following lines https://github.com/facebook/react-native/blob/master/packager/react-native-xcode.sh#L15-L18 . It was mentioned here and worked for me

Getting the exact same in 0.46.1.

I was getting this in 0.44, had to import ./app/index instead of ./app for some reason. A more useful error would have been helpful!

@Luckygirlllll did you run npm install -g react-native-git-upgrade first?

The hack works, but any updates on this from the React team?

I know this sort of feels like a hack, but currently that’s the only way to fix it. I believe this would be fixed in the coming days.