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

Missing import statement in the src/index.js file. #431

Closed
Kuljeet-123 opened this issue Oct 23, 2024 · 4 comments
Closed

Missing import statement in the src/index.js file. #431

Kuljeet-123 opened this issue Oct 23, 2024 · 4 comments

Comments

@Kuljeet-123
Copy link

I encountered an issue where our app kept crashing after installing the package. Upon examining the code, I realized that there was a missing import in the library file src/index.js.

The current code is:

import { DeviceEventEmitter, NativeEventEmitter, NativeModules } from 'react-native';
const CleverTapReact = require('./NativeCleverTapModule').default;
const EventEmitter = Platform.select({
    ios: new NativeEventEmitter(CleverTapReact),
    android: DeviceEventEmitter
});

Ideally, it should be:

import { DeviceEventEmitter, NativeEventEmitter, NativeModules, Platform } from 'react-native';
const CleverTapReact = require('./NativeCleverTapModule').default;
const EventEmitter = Platform.select({
    ios: new NativeEventEmitter(CleverTapReact),
    android: DeviceEventEmitter
});

This resolves the crash issue.

@Anush-Shand
Copy link
Contributor

@Kuljeet-123
Thanks for raising this issue. We will be fixing this shortly in the upcoming release. Can you please confirm if your react native app is an expo-app?

@Kuljeet-123
Copy link
Author

@Anush-Shand
Yes, I'm using Expo.

@Anush-Shand
Copy link
Contributor

Thanks for confirming @Kuljeet-123
clevertap-react-native doesn't officially support expo yet and this issue is only faced on expo-apps

We will be fixing it the upcoming release nonetheless. The release is schedule before the end of this month
Thanks

@piyush-kukadiya
Copy link
Contributor

Fixed in release 3.1.0

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

No branches or pull requests

3 participants