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

🔥Crash on Android caught in Automation: Tried to access a JS module before the React instance was fully set up #106

Open
Harsh0 opened this issue Mar 7, 2024 · 0 comments

Comments

@Harsh0
Copy link
Contributor

Harsh0 commented Mar 7, 2024

Our automation has caught crash for Android with the following stack trace

CRASH HAS OCCURRED
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:176 undefined)
   at com.oblador.performance.PerformanceModule.emit(PerformanceModule.java:204 undefined)
   at com.oblador.performance.PerformanceModule.emitMark(PerformanceModule.java:175 undefined)
   at com.oblador.performance.PerformanceModule.safelyEmitMark(PerformanceModule.java:147 undefined)
   at com.oblador.performance.PerformanceModule.emitNativeStartupTime(PerformanceModule.java:122 undefined)
   at com.oblador.performance.PerformanceModule.lambda$setupMarkerListener$1(PerformanceModule.java:132 undefined)
   at com.oblador.performance.PerformanceModule.$r8$lambda$Yo12vAzqJBXSMDuPrVIhk_ZK_tE(PerformanceModule.java:0 undefined)
   at com.oblador.performance.PerformanceModule$ExternalSyntheticLambda0.logMarker(R8$SyntheticClass:0 undefined)
   at com.facebook.react.bridge.ReactMarker.logMarker(ReactMarker.java:141 undefined)
   at com.facebook.react.ReactRootView.onViewAdded(ReactRootView.java:449 undefined)
   at android.view.ViewGroup.dispatchViewAdded(ViewGroup.java:5157 undefined)
   at android.view.ViewGroup.addViewInner(ViewGroup.java:5329 undefined)
   at android.view.ViewGroup.addView(ViewGroup.java:5104 undefined)
   at android.view.ViewGroup.addView(ViewGroup.java:5044 undefined)
   at com.facebook.react.uimanager.ViewGroupManager.addView(ViewGroupManager.java:38 undefined)
   at com.facebook.react.uimanager.NativeViewHierarchyManager.manageChildren(NativeViewHierarchyManager.java:533 undefined)

To Reproduce

  • Navigate to React Native page in application
  • Clear cache and force stop the app
  • Relaunch the app
  • Repeat until you repro as it is intermittent

Expected Behavior

App should not crash

Environment

"react-native-performance": "^4.0.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

1 participant