Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to execute JS call: __fbBatchedBridge is undefined #6282

Closed
jandom opened this issue Mar 4, 2016 · 33 comments
Closed

Unable to execute JS call: __fbBatchedBridge is undefined #6282

jandom opened this issue Mar 4, 2016 · 33 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@jandom
Copy link

jandom commented Mar 4, 2016

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!

@grabbou
Copy link
Contributor

grabbou commented Mar 4, 2016

Hey,

So, none of the already proposed solutions in the closed issues works for you yet? :(

Leaving the search link for reference: https://github.com/facebook/react-native/issues?utf8=%E2%9C%93&q=__fbBatchedBridge

@jandom
Copy link
Author

jandom commented Mar 4, 2016

Hey,

Thanks for getting back so quickly. Yeah, tried a handful yesterday and a few today – but it's hard to do a complete enumeration...

However, irrespectively of whether there is a fix in one of those Issues, this is likely close to a step-by-step copy&paste instructions that new users will follow, since this is the vanilla AwesomeProject.

Here is what i tried:

Again, thanks for getting back so fast and providing this support.

@chiraggshah
Copy link
Contributor

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

@jandom
Copy link
Author

jandom commented Mar 4, 2016

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

@jandom jandom closed this as completed Mar 4, 2016
@jandom
Copy link
Author

jandom commented Mar 4, 2016

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?

@Jeanmsilva89
Copy link

👍 This solution also worked for me. I just started a new project on React-Native 0.21.0

@chiraggshah
Copy link
Contributor

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.

@h8rry
Copy link

h8rry commented Apr 19, 2016

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

@philohelp
Copy link

Worked here too RN0.22

@luzuoquan
Copy link

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

@longsangstan
Copy link

The uncomment solution works!
Just wondering is there any side effect for this?
My RN version: 0.26.2

@nverdhan
Copy link
Contributor

@longsangstan The code is for speeding up build times as stated

# Speed up build times by skipping the creation of the offline package for debug
# builds on the simulator since the packager is supposed to be running anyways.

, so commenting it should just affect build-times, no other side-effects supposedly.

@ThomasRedstone
Copy link

Should this still be occurring for 0.39.2?
I'm getting the same error message, and the fix is working on macOS, building for iOS.

@ghost
Copy link

ghost commented Jan 23, 2017

Just ran into this issue today as well, any ideas?

@ameego
Copy link

ameego commented Jan 24, 2017

@tonydiepenbrock, same here!

@MattyK14
Copy link

Occurring on 0.40.0

@SteffenBerlin
Copy link

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

@pdoggi
Copy link

pdoggi commented Feb 18, 2017

Getting error on react-native 0.41.2. Commenting https://github.com/facebook/react-native/blob/master/packager/react-native-xcode.sh#L17-L20 fixes it for me.

@ferologics
Copy link

Occurring on 0.41.0

@jarsen
Copy link

jarsen commented Mar 6, 2017

I was having this problem on 0.42.0 when launching from vscode. I somehow got it fixed by quitting the simulator, and first running react-native run-ios. Now it works when I launch from vscode.

@fabe
Copy link

fabe commented Mar 7, 2017

Running react-native-git-upgrade fixed this for me.
(Has to be installed w/ npm install -g react-native-git-upgrade first.)

@Luckygirlllll
Copy link

I have the same problem on 0.42.0, commenting didn't help me, and when I tried "react-native-git-upgrade" , it just says "command not found". Any ideas how to fix it?

@MattyK14
Copy link

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

@Luckygirlllll
Copy link

@MattyK14 Just have tried it, so I done react-native-git-upgrade, and after that react-native run-ios, and the error didn't disappear.

@MaxwellGover
Copy link

I'm on the latest version 0.43 and still getting this issue? :(

@sekoyo
Copy link

sekoyo commented Jun 4, 2017

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!

@LAITONEN
Copy link
Contributor

LAITONEN commented Jul 13, 2017

0.46 keep constantly getting this error.

@jpmonette
Copy link

Getting the exact same in 0.46.1.

@martinezguillaume
Copy link
Contributor

same here, 0.45 with expo sdk 18

@Stophface
Copy link

Stophface commented Jul 21, 2017

same here

@thewilliamchan
Copy link

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.

@aterribili
Copy link

I'm getting it in production on iOS. Any news?

@LAITONEN
Copy link
Contributor

LAITONEN commented Aug 3, 2017

Not getting this error anymore. Maybe because:

  • I started using LAN or localhost hosts of Expo.
  • Expo got updated
  • Started using simulator more often than phone itself for testing

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests