oblador / react-native-performance

📐 Monitor and measure React Native performance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Harsh0 opened this issue · comments

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"