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

Infinite recursion in RCTFatal when the bundle fails to execute #5090

Closed
ide opened this issue Jan 3, 2016 · 35 comments
Closed

Infinite recursion in RCTFatal when the bundle fails to execute #5090

ide opened this issue Jan 3, 2016 · 35 comments
Assignees
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@ide
Copy link
Contributor

ide commented Jan 3, 2016

RCTFatal calls _RCTLogNativeInternal which enqueues a JS call. This can fail because a previous RCTFatal occurred because the bundle failed to execute in the first place. So when RCTFatal fails, it ends up calling RCTFatal again in an infinite loop.

cc @javache

@ide ide added the Platform: iOS iOS applications. label Jan 3, 2016
@javache
Copy link
Member

javache commented Jan 5, 2016

I believe I fixed this in 0cfe763

If an error happens as part of bridge init, the JS executor is invalidated and will no longer enqueue the JS call.

@skevy
Copy link
Contributor

skevy commented Jan 5, 2016

@javache I encountered this error on master about 3 days ago, fyi.

@philikon
Copy link
Contributor

philikon commented Jan 8, 2016

I don't believe 0cfe763 fixed this because the bug is present in 0.18.0rc.

@javache
Copy link
Member

javache commented Jan 8, 2016

@philikon Can you provide an example of how to reproduce this? If something as fundamental as __fbBatchedBridge is broken, it should be caught during startup and cause the bridge to be invalidated.

Either way, this bug should only be present when debugging using the Chrome executor.

@jvliwanag
Copy link

Using a new 0.18.0rc project. Replace the contents of index.ios.js with:

asdfasdf

Doesn't need to run on chrome executor.

@yueshuaijie
Copy link

I encountered this error, too. Hope to find a solution.

@philikon
Copy link
Contributor

philikon commented Jan 9, 2016

@javache I get this if the package server isn't reachable / running for the app.

#4739 seems related.

@Creemli
Copy link

Creemli commented Jan 12, 2016

I also see this error when i use 0.18.0-rc with bundled js.

@Purii
Copy link
Contributor

Purii commented Jan 12, 2016

Me too @Creemli
I get this error only, when I use bundled js.

@stereodenis
Copy link
Contributor

waiting for fix too

@Creemli
Copy link

Creemli commented Jan 13, 2016

@Purii I fixed this issue by copying the code from http://localhost:8081/index.ios.bundle to main.jsbundle. And it works well~~~

@Purii
Copy link
Contributor

Purii commented Jan 14, 2016

@Creemli doesn't work for me. Neither with dev=false nor dev=true

@Mokto
Copy link

Mokto commented Jan 14, 2016

I also got this error.

@javache javache self-assigned this Jan 15, 2016
@javache
Copy link
Member

javache commented Jan 15, 2016

This is now failing recursively because we check more carefully for an invalid bundle (5b4e873). I'm looking to see if there's any way we can bail out earlier in this case without breaking other debug tools.

@Purii
Copy link
Contributor

Purii commented Jan 15, 2016

@javache

check more carefully for an invalid bundle

Does this mean, that there is something wrong with our code, or is it the packager which fails?

@javache
Copy link
Member

javache commented Jan 15, 2016

@Purii: yes, please verify that the bundle you're trying to load in the packager is valid.

@Purii
Copy link
Contributor

Purii commented Jan 16, 2016

@javache Running eslint on the bundle throws the following errors:

  • "babelHelpers" is not defined
  • "__d" is not defined
  • "__BUNDLE_START_TIME__" is not defined
  • "self" is not defined
  • "__REACT_DEVTOOLS_GLOBAL_HOOK__" is not defined
  • "GLOBAL" is not defined
  • "window" is read only
  • "MessageChannel" is not defined
  • "FileReader" is not defined
  • "Blob" is not defined
  • "FormData" is not defined
  • "Node" is not defined
  • "math" is not defined
  • "regeneratorRuntime" is not defined

The list looks similar on a new project with 0.17.0.
Checking my source files via eslint doesn't throw any error.

@dsernst
Copy link

dsernst commented Jan 17, 2016

Seeing this after following the standard instructions from https://facebook.github.io/react-native/docs/getting-started.html#quick-start

@Purii
Copy link
Contributor

Purii commented Jan 18, 2016

Seems to be fixed with 0.18.0-final.

@danscan
Copy link
Contributor

danscan commented Jan 19, 2016

I'm seeing this issue after upgrading a project from 0.15 to 0.18. I used react-native upgrade, and updated deps that can now depend on react.

@jasonmerino
Copy link

I'm seeing this issue after trying to upgrade from 0.16 to 0.18. I also used react-native upgrade.

ghost pushed a commit that referenced this issue Jan 19, 2016
Summary:
This solves #5090. Since 5b4e873 we had better reporting for when calls from native to JS fail. When trying to load an invalid bundle, this would now cause a stackoverflow, since RCTFatal would schedule a JS call to log, which would RCTFatal, which would ...

By invalidating the jsExecutor immediately after loading fails, we prevent any more attempts to log. We can't invalidate the whole bridge at this point since we still need the redbox module to actually display the error.

public

Reviewed By: majak

Differential Revision: D2834251

fb-gh-sync-id: a3e2ad425e40560beae4d3eacb93f66ace5341bf
@yueshuaijie
Copy link

I'm seeing this issue in 0.18.0-rc, after upgrade to 0.18.0, it disappeared.

mkonicek pushed a commit that referenced this issue Jan 20, 2016
Summary:
This solves #5090. Since 5b4e873 we had better reporting for when calls from native to JS fail. When trying to load an invalid bundle, this would now cause a stackoverflow, since RCTFatal would schedule a JS call to log, which would RCTFatal, which would ...

By invalidating the jsExecutor immediately after loading fails, we prevent any more attempts to log. We can't invalidate the whole bridge at this point since we still need the redbox module to actually display the error.

public

Reviewed By: majak

Differential Revision: D2834251

fb-gh-sync-id: a3e2ad425e40560beae4d3eacb93f66ace5341bf
@mkonicek
Copy link
Contributor

@javache tells me this one should help too: 8ea9a1b, just released 0.18.1 with that commit. Give it a try.

No need to react-native upgrade, simply update the version in package.json. It's an iOS only change, we introduced the upgrade command mostly because of Android.

MattFoley pushed a commit to skillz/react-native that referenced this issue Jan 21, 2016
Summary:
This solves facebook#5090. Since facebook@5b4e873 we had better reporting for when calls from native to JS fail. When trying to load an invalid bundle, this would now cause a stackoverflow, since RCTFatal would schedule a JS call to log, which would RCTFatal, which would ...

By invalidating the jsExecutor immediately after loading fails, we prevent any more attempts to log. We can't invalidate the whole bridge at this point since we still need the redbox module to actually display the error.

public

Reviewed By: majak

Differential Revision: D2834251

fb-gh-sync-id: a3e2ad425e40560beae4d3eacb93f66ace5341bf
brentvatne pushed a commit to expo/react-native that referenced this issue Jan 22, 2016
Summary:
This solves facebook#5090. Since facebook@5b4e873 we had better reporting for when calls from native to JS fail. When trying to load an invalid bundle, this would now cause a stackoverflow, since RCTFatal would schedule a JS call to log, which would RCTFatal, which would ...

By invalidating the jsExecutor immediately after loading fails, we prevent any more attempts to log. We can't invalidate the whole bridge at this point since we still need the redbox module to actually display the error.

public

Reviewed By: majak

Differential Revision: D2834251

fb-gh-sync-id: a3e2ad425e40560beae4d3eacb93f66ace5341bf
@23c
Copy link

23c commented Jan 24, 2016

I downgrade to 0.16.0 version, over this problem.

@mkonicek
Copy link
Contributor

8ea9a1b released with 0.18.1 should be the fix. Let's close this and reopen if it still appears in 0.18.1 and later versions.

@mixophrygian
Copy link

just encountered this in 0.18.0 - somehow ReactLog.m was getting a new line (\n) prepended to the top of the file. Problem went away when it was removed.

@dvcrn
Copy link
Contributor

dvcrn commented Jan 25, 2016

Just encountered this with 0.18.1. Didn't have it in 0.18-rc but since the update this is appearing for me as well

@leeabc
Copy link

leeabc commented Jan 25, 2016

Still get this issue in 0.18.1

Step:

  1. npm install --save react-native@0.18
  2. react-native upgrade
  3. run in xcode

[error][tid:com.facebook.React.JavaScript] Unable to execute JS call: __fbBatchedBridge is undefined

Could someone can help on this case ?

@javache
Copy link
Member

javache commented Jan 25, 2016

That means something went wrong with loading/executing your JS bundle. This task only concerns infinite recursion happening as a side-effect of that. Please open a new issue instead.

@DickyT
Copy link

DickyT commented Jan 28, 2016

also got this issue sometimes, using bundled js without dev mode in 0.19-rc

@stereodenis
Copy link
Contributor

@javache got this issue with 0.19
I think react-native-xcode.sh is not packing main.jsbundle

@ide
Copy link
Contributor Author

ide commented Feb 3, 2016

@stereodenis are you experiencing infinite recursion or seeing __fbBatchedBridge is undefined?

@shohey1226
Copy link

I saw this with 0.19 when I tried to run on device after upgraded from 0.13. I checked in the log and realized that react-native-xcode.sh is just missing.. needed to do work on https://facebook.github.io/react-native/docs/upgrading.html#manual-upgrades

@stereodenis
Copy link
Contributor

@ide __fbBatchedBridge is undefined

@javache
Copy link
Member

javache commented Feb 4, 2016

Please file a new issue when you're just seeing this error. __fbBatchedBridge is undefined points at issues with the JS bundle setup. Since the infinite recursion here has been resolved, I'm locking this issue.

@facebook facebook locked and limited conversation to collaborators Feb 4, 2016
@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
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests