react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

Failed to call into JavaScript module method RCTEventEmitter.receiveEvent()

Open AkramHarazem opened this issue 3 months ago • 12 comments

Description

Description After wrapping app using <SafeAreaProvider>…</SafeAreaProvider>

Getting following error,

Uncaught Error

{ "message": "Error: Failed to call into JavaScript module method RCTEventEmitter.receiveEvent(). Module has not been registered as callable. Registered callable JavaScript modules (n = 9): AppRegistry, HMRClient, GlobalPerformanceLogger, RCTNativeAppEventEmitter, SamplingProfiler, RCTDeviceEventEmitter, RCTLog, HeapCapture, Systrace. Did you forget to call registerCallableModule?", "stack": [] }

If I remove <SafeAreaProvider>…</SafeAreaProvider> . App works fine but without insets which causes issues with margins on top

React-native-navigation 8.3.2

Steps to reproduce

Upgraded to 077.3 Upgraded react-native-safe-area-context to 5.6.1 and this issue started happening

Snack or a link to a repository

https://github.com/AppAndFlow/react-native-safe-area-context/issues/661

Safe Area Context version

5.6.1

React Native version

0.77.3

Platforms

iOS

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

iPhone 16 Pro Max

Acknowledgements

Yes

AkramHarazem avatar Sep 22 '25 10:09 AkramHarazem

Image

AkramHarazem avatar Sep 22 '25 10:09 AkramHarazem

@AkramHarazem I'm facing the same issue, are you using react-native-navigation? I have the same issue on iOS:

"react-native-navigation": "8.2.1",
"react-native": "0.77.3",

DriesVS avatar Sep 23 '25 21:09 DriesVS

@AkramHarazem I'm facing the same issue, are you using react-native-navigation? I have the same issue on iOS:

"react-native-navigation": "8.2.1",
"react-native": "0.77.3",

yes React-native-navigation: 8.3.2

AkramHarazem avatar Sep 24 '25 05:09 AkramHarazem

@AkramHarazem I'm facing the same issue, are you using react-native-navigation? I have the same issue on iOS:

"react-native-navigation": "8.2.1",
"react-native": "0.77.3",

yes React-native-navigation: 8.3.2

Hi, have you fixed this error yet i am having the same error

"react-native-safe-area-context": "^5.5.2", "react-native": "0.81.4",

Roasted-Peanut avatar Oct 09 '25 06:10 Roasted-Peanut

{
    "react-native": "0.81.0",
    "react-native-safe-area-context": "^5.6.1",
    "@react-navigation/native": "^7.1.17"
}

Getting this too while trying to migrate to the new arch :(

Found this stack overflow post that has some potentially similar comments.

I can repro the error with minimal App.tsx like

export default () => {
  return (
    // Commenting this Provider out fixes the error
    <SafeAreaProvider>
      <View>
        <Text>Hello world</Text>
      </View>
    </SafeAreaProvider>
  )

ethaneng avatar Oct 10 '25 02:10 ethaneng

{ "react-native": "^0.77.0", "react-native-safe-area-context": "^5.6.1" }

facing the same error after upgrading.
Has there been any update or fix regarding this?

Girish-GAP avatar Oct 10 '25 09:10 Girish-GAP

I was stuck on this for hours and upgrading AppDelegate to Swift fixed the issue (even if I thought they were doing the same and it was just synthax, but it was probably not).

jmmgreg avatar Oct 16 '25 23:10 jmmgreg

{ "react-native": "^0.82.0", "react-native-safe-area-context": "^5.6.2" }

facing the same error after upgrading. Has there been any update or fix regarding this?

shammi-coach avatar Nov 07 '25 07:11 shammi-coach

I upgraded to React native 0.81.5 And I was able to resolve this error by following https://reactnative.dev/blog/2025/01/21/version-0.77#rctappdependencyprovider

#import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>

self.dependencyProvider = [RCTAppDependencyProvider new];

ShahbazBbs avatar Nov 17 '25 17:11 ShahbazBbs

I upgraded to React native 0.81.5 And I was able to resolve this error by following https://reactnative.dev/blog/2025/01/21/version-0.77#rctappdependencyprovider

#import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>

self.dependencyProvider = [RCTAppDependencyProvider new];

This was it! I don't understand how this is not in the diff when using the upgrade helper. I had to add this into my swift AppDelegate and this example only had the objective-c example.

ninjz avatar Nov 21 '25 11:11 ninjz

I upgraded to React native 0.81.5 And I was able to resolve this error by following https://reactnative.dev/blog/2025/01/21/version-0.77#rctappdependencyprovider

#import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>

self.dependencyProvider = [RCTAppDependencyProvider new];

This solution also worked for me. I upgraded from React Native 0.74.5 to React Native 0.82.0. I'm assuming this issue can be closed?

wsan3 avatar Dec 05 '25 07:12 wsan3

I upgraded to React native 0.81.5 And I was able to resolve this error by following https://reactnative.dev/blog/2025/01/21/version-0.77#rctappdependencyprovider

#import <ReactAppDependencyProvider/RCTAppDependencyProvider.h>

self.dependencyProvider = [RCTAppDependencyProvider new];

This solution also worked for me, on React Native upgrade 0.74.6 -> 0.78.0

josippr avatar Dec 17 '25 11:12 josippr