React-native: 0.57.0-rc.3: Attempted to invoke `4` (method ID) on `UIManager` (NativeModule name) with an invalid bridge.

Created on 30 Aug 2018  路  9Comments  路  Source: facebook/react-native

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14
      CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
      Memory: 107.23 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.2 - ~/.nvm/versions/node/v8.11.2/bin/node
      Yarn: 1.7.0 - ~/.nvm/versions/node/v8.11.2/bin/yarn
      npm: 5.10.0 - ~/.nvm/versions/node/v8.11.2/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      @types/react: 16.4.12 => 16.4.12
      @types/react-native: 0.56.15 => 0.56.15
      react: 16.4.2 => 16.4.2
      react-native: 0.57.0-rc.3 => 0.57.0-rc.3
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

bug

In iOS Simulator these things will trigger the above error:

  • Live Reloads
  • Pressing Cmd+D and hit Reload or any other action that triggers reload.

However doing straight Cmd+R in the Simulator will not trigger the error, in most cases, I've seen it randomly pop up. Also, HMR won't trigger the error.

Stack trace:

Attempted to invoke `4` (method ID) on `UIManager` (NativeModule name) with an invalid bridge.

facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
    RCTNativeModule.mm:83
facebook::react::ModuleRegistry::callNativeMethod(unsigned int, unsigned int, folly::dynamic&&, int)
facebook::react::JsToNativeBridge::callNativeModules(facebook::react::JSExecutor&, folly::dynamic&&, bool)
facebook::react::JSCExecutor::callNativeModules(facebook::react::Value&&)
facebook::react::JSCExecutor::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, folly::dynamic const&)
facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1::operator()(facebook::react::JSExecutor*) const
void std::__1::__invoke_void_return_wrapper<void>::__call<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1&, facebook::react::JSExecutor*>(facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1&&&, facebook::react::JSExecutor*&&)
std::__1::__function::__func<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1, std::__1::allocator<facebook::react::NativeToJsBridge::callFunction(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&, folly::dynamic&&)::$_1>, void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*&&)
std::__1::function<void (facebook::react::JSExecutor*)>::operator()(facebook::react::JSExecutor*) const
facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_7::operator()() const
void std::__1::__invoke_void_return_wrapper<void>::__call<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_7&>(facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_7&&&)
std::__1::__function::__func<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_7, std::__1::allocator<facebook::react::NativeToJsBridge::runOnExecutorQueue(std::__1::function<void (facebook::react::JSExecutor*)>)::$_7>, void ()>::operator()()
std::__1::function<void ()>::operator()() const
facebook::react::tryAndReturnError(std::__1::function<void ()> const&)
facebook::react::RCTMessageThread::tryFunc(std::__1::function<void ()> const&)
facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1::operator()() const
void std::__1::__invoke_void_return_wrapper<void>::__call<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&>(facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1&&&)
std::__1::__function::__func<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1, std::__1::allocator<facebook::react::RCTMessageThread::runOnQueue(std::__1::function<void ()>&&)::$_1>, void ()>::operator()()
std::__1::function<void ()>::operator()() const
invocation function for block in facebook::react::RCTMessageThread::runAsync(std::__1::function<void ()>)
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__
__CFRunLoopDoBlocks
__CFRunLoopRun
CFRunLoopRunSpecific
+[RCTCxxBridge runRunLoop]
__NSThread__start__
_pthread_body
_pthread_start
thread_start

Reproducible Demo

https://github.com/ueno-llc/react-native-starter on the development branch

iOS Fixed Locked

Most helpful comment

@jqn agreed.
@kelset I'm using 57.1.0 and it is spamming the app non-stop about these warnings.

Warning logs spam will cause developers to turn off warnings all together which will result in them making more mistakes which will decrease the developer experience of React Native as a whole.

Is it possible to fix the root cause of the issue and remove the warnings?

All 9 comments

If, as you mentioned in the discussion, this https://github.com/facebook/react-native/commit/f94521244798f859648d1769f397102c06d763f0 fixes the issue can you close this once rc4 is released?

@kelset Now instead of the red screen we are experiencing yellow warnings. Appreciate the fix but yellow warnings are still bothersome.

Well anyway this issue can be closed then.

@jqn agreed.
@kelset I'm using 57.1.0 and it is spamming the app non-stop about these warnings.

Warning logs spam will cause developers to turn off warnings all together which will result in them making more mistakes which will decrease the developer experience of React Native as a whole.

Is it possible to fix the root cause of the issue and remove the warnings?

I'm using 57.1.0 as well and is really spamming a lot with these yellow warnings, are these warnings safe to ignore?

Same on 0.57.2.

Hi guys, any updates on this issue, warning keep spamming. im on 0.57.1

Is it possible to fix the root cause of the issue and remove the warnings?

Feel free to submit PRs to fix those warnings.

Was this page helpful?
0 / 5 - 0 ratings