expo / router

[ARCHIVE]: Expo Router has moved to expo/expo -- The File-based router for universal React Native apps

Home Page:https://docs.expo.dev/routing/introduction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WARNING: "`new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method." when running app in development build

MarchewkaMatthew opened this issue · comments

Which package manager are you using? (Yarn is recommended)

npm

Summary

Hi everyone,

I wanted to try out the new expo-router 2.0. Everything seemed fine in the "Expo Go" application but after creating a development build (via eas build) for the real Android device, I'm experiencing this warning:
image
Is there anyone else facing this? I can see that there are no other reports connected to that here. Is ignoring the logs the only option or is there an option to fix it? I can see a couple of issues reported in other RN repos like here: react-native-netinfo/react-native-netinfo#486

Any help would be much appreciated!

Here are the related packages versions:

    "expo": "~49.0.5",
    "@react-navigation/native": "^6.0.2",
    "expo-router": "2.0.0",
    "typescript": "^5.1.3",

Minimal reproducible example

  1. Initialize the project with: npx create-expo-app@latest --template tabs@sdk-49
  2. Configure & build the app via eas build
  3. Run the development build on real android device
  4. Check warning in the developer console

I made some tweaks to the initial project but I think that these are unrelated (adding some side packages etc.)

managed to solve? even here

Any fix? I am getting same on emulator and device.

only on android

Expo Router doesn't use the NativeEventEmitter so this warning would be coming from a dependency. Its warning because omitting removeListeners is a common cause of memory leaks - but it doesn't mean that your app won't work, or that there isa
memory leak. I'll investigate the warning and try and find if is a direct dependency we need to update.

You should be safe to ignore the warning until then.

commented

got the same error using expo-notifications

Same error after upgrading to SDK 50: new NativeEventEmitter() was called with a non-null argument without the required removeListeners method. It is really annoying, I removed each dependencies one by one, but still unsolved problem. Any help will be appreciated. Thanks.