Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

React Native - Expo 48 crash with "Cannot read property '__expo_module_name__' of undefined #114

Closed
lakardion opened this issue Apr 5, 2023 · 12 comments

Comments

@lakardion
Copy link

Hello!. I'm getting crashes on Expo 48 latest. I think it has to do with hermes. This is the error:

 ERROR  TypeError: Cannot read property '__expo_module_name__' of undefined, js engine: hermes

This happens at:
node_modules/@pubnub/react-native-chat-components/dist/commonjs/index.js

        if (nativeModule.__expo_module_name__ && reactNative.NativeModules.EXReactNativeEventEmitter) {

Here's a repo I have which is crashing with this error:

https://github.com/lakardion/test-gesture-handler

I tried this out on SDK 47 but it works properly. Seems like this is specific to expo 48 ?

Thanks!

@Justin-Terry
Copy link

Justin-Terry commented Apr 6, 2023

Also experiencing the same issue in new SDK 48 project.

To reproduce:

  1. Create a new Expo app with npx create-expo-app <name>
  2. Install PubNub libraries
    npx expo install pubnub pubnub-react @pubnub/react-native-chat-components
  3. Import anything component from @pubnub/react-native-chat-components into App.js

That's it. Just importing it is enough to cause the error.

  "name": "minimum-example",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@pubnub/react-native-chat-components": "^0.23.0",
    "expo": "~48.0.10",
    "expo-status-bar": "~1.4.4",
    "pubnub": "^7.2.2",
    "pubnub-react": "^3.0.2",
    "react": "18.2.0",
    "react-native": "0.71.6"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}

@Olli2
Copy link

Olli2 commented Apr 16, 2023

+1

@Salet
Copy link
Contributor

Salet commented Apr 18, 2023

This problem should be fixed with the 0.27.0 version of @pubnub/react-native-chat-components which was just released. @lakardion @Justin-Terry @Olli2 please update your dependency and let us know if it worked. At the same time, the package will most likely stop working with Expo versions below 48.

@lakardion
Copy link
Author

@Salet Thank you! It is building just fine on my end

@Salet Salet closed this as completed Apr 19, 2023
@Salet
Copy link
Contributor

Salet commented Apr 19, 2023

Update: please update to 0.27.0 instead, we introduced a problem with sending messages in RN in 0.26.0 by mistake

@OzanOcak
Copy link

After installing expo-av, I got the same error.

@jethrozz
Copy link

After installing expo-av, I got the same error.

@OzanOcak hello , Did you solve this problem?

@OzanOcak
Copy link

Thank you for asking, I was just able to find out what it was going on after spending so much time on it, all I need was building a new apk for virtual machine. it makes sense actually, sounds are hardware related, there must be os level linking. oh I spent so much time :)

@TatMinhNguyen
Copy link

I also got this error when installing expo-ads-admob

@JoaoHamerski
Copy link

I was getting this error when trying to install a expo package in a React Native CLI or Expo Bare template, if you aren't using expo blank template, you'll need to configure your app to install expo modules: https://docs.expo.dev/bare/installing-expo-modules/

After that the most important thing is running npm run android or npm run ios to build your native configuration, then you can call your expo package from JavaScript normally.

@OzanOcak
Copy link

OzanOcak commented Dec 8, 2023

I also got this error when installing expo-ads-admob

In my case, I didn't get the error if I build the project. Just create a new executable file with the new packages included.

@Tosey
Copy link

Tosey commented Dec 24, 2023

This problem should be fixed with the 0.27.0 version of @pubnub/react-native-chat-components which was just released. @lakardion @Justin-Terry @Olli2 please update your dependency and let us know if it worked. At the same time, the package will most likely stop working with Expo versions below 48.

I'm having the same problem with the expo-ads-admob package as well.
But are you saying that we should install "@pubnub/react-native-chat-components": "0.27.0", alongside expo-ads-admob package for the error to be fixed?
Just to be sure. Because i just tried it from my own end and it didn't work.
I'm using: "expo": "~49.0.7",

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants