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

Error on using UI components: "new NativeEventEmitter() requires a non-null argument. #2545

Closed
1 of 8 tasks
mpinchover opened this issue Jun 9, 2024 · 2 comments
Closed
1 of 8 tasks

Comments

@mpinchover
Copy link

mpinchover commented Jun 9, 2024

Issue

When using Stream UI components in a new Expo project, an uncaught error appears:

Invariant Violation: `new NativeEventEmitter()` requires a non-null argument., js engine: hermes

I was unable to find any support online for how to get rid of this error.

Code for project:

import { SafeAreaView, Text } from "react-native";
import { StreamChat } from "stream-chat";
import { OverlayProvider } from "stream-chat-react-native";

const client = StreamChat.getInstance("my-api-key");

export default function HomeScreen() {
  return (
    <SafeAreaView>
      <OverlayProvider>
        <Text>Hello</Text>
      </OverlayProvider>
    </SafeAreaView>
  );
}

Dependencies

 "stream-chat": "^8.35.0",
 "stream-chat-react-native": "^5.31.1"

Describe your issue here

Steps to reproduce

Steps to reproduce the behavior:

Expo has a new flow now where you can choose to create an Expo Go project or an Expo Development project. Expo Go is not meant for production builds, but more to quickly test out how Expo is used.

Make sure to choose iOS simulator, development build here and uncheck Build with Expo Application Services (EAS).

Run app npm run start

Expected behavior

App should be able to compile and open.

Project Related Information

Customization

Click To Expand

# N/A

Offline support

  • I have enabled offline support.
  • The feature I'm having does not occur when offline support is disabled. (stripe out if not applicable)

Environment

Running node v20.13.1

Click To Expand

package.json:

# N/A

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • stream-chat-react-native version you're using that has this issue:
    • e.g. 5.4.3
  • Device/Emulator info:
    • I am using a physical device
    • OS version: e.g. Android 10
    • Device/Emulator: e.g. iPhone 11

Additional context

Screenshots

Screenshot 2024-06-09 at 6 29 06 PM
@khushal87
Copy link
Member

Hey @mpinchover, if you are using expo to build your project, why are you using stream-chat-react-native? Instead you should use stream-chat-expo.

@khushal87
Copy link
Member

Closing this issue in favour of not being able to reproduce it. Please reopen it if you still find it relevant. For expo please follow the installation guide.

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

No branches or pull requests

2 participants