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

Getting IllegalStateException: Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should only happen once initialize() has been called on your native module. #775

Closed
tusharprajapati8888 opened this issue Sep 21, 2021 · 8 comments

Comments

@tusharprajapati8888
Copy link

tusharprajapati8888 commented Sep 21, 2021

I'm getting the below crash report in firebase crashlytics (Only Android).

I am not able to reproduce on my device but seems like live users are facing this.

Any help would be highly appreciated.

Fatal Exception: java.lang.IllegalStateException: Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should only happen once initialize() has been called on your native module.
       at com.facebook.react.bridge.ReactContext.getJSModule(ReactContext.java:148)
       at com.wix.reactnativenotifications.core.JsIOHelper.sendEventToJS(JsIOHelper.java:21)
       at com.wix.reactnativenotifications.core.JsIOHelper.sendEventToJS(JsIOHelper.java:13)
       at com.wix.reactnativenotifications.core.notification.PushNotification.notifyReceivedBackgroundToJS(PushNotification.java:208)
       at com.wix.reactnativenotifications.core.notification.PushNotification.onReceived(PushNotification.java:68)
       at com.wix.reactnativenotifications.fcm.FcmInstanceIdListenerService.onMessageReceived(FcmInstanceIdListenerService.java:28)
       at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(com.google.firebase:firebase-messaging@@21.1.0:13)
       at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(com.google.firebase:firebase-messaging@@21.1.0:8)
       at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(com.google.firebase:firebase-messaging@@21.1.0:3)
       at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(com.google.firebase:firebase-messaging@@21.1.0:3)
       at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(com.google.firebase:firebase-messaging@@21.1.0:1)
       at com.google.firebase.messaging.EnhancedIntentService$$Lambda$0.run(:6)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@17.3.0:6)
       at java.lang.Thread.run(Thread.java:764)

Firebase crash report android

@stale
Copy link

stale bot commented Oct 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

1 similar comment
@stale
Copy link

stale bot commented Nov 20, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the 🏚 stale label Nov 20, 2021
@stale
Copy link

stale bot commented Nov 27, 2021

The issue has been closed for inactivity.

@stale stale bot closed this as completed Nov 27, 2021
@moonbe77
Copy link

I'm facing the same issue, It happens if the app receives a notification while is being opened.
How to reproduce,
Trigger a notification and tap on the app icon just before the notification is received (might need some attempts to get the timing right).
Found this issue with the same symptoms.
OneSignal/react-native-onesignal#877

@aelmadani
Copy link

I've got same error. Did anyone find a solution?

@dembal1990
Copy link

I downgrade "expo-notifications" to "0.20.0" version. This is fixed my issue.

@EnricoMazzu
Copy link

I've found a way to prevent the crash.
Can i reopen a new issue with the PR?

@levepic
Copy link

levepic commented Oct 3, 2024

I've found a way to prevent the crash. Can i reopen a new issue with the PR?

Im receiving these errors with my RN 0.74 app since i added vision camera, i suspect the increased loadup time of the app made these crashes happen. Nothing has changed regarding push notifications

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

6 participants