wonday / react-native-pdf

A <Pdf /> component for react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tried to access a JS module before the React instance was fully set up.

akbaraditamasp opened this issue · comments

What react-native version are you using?
0.74.1
What react-native-pdf version are you using?
6.7.5
What platform does your issue occur on? (android/ios/both)
Android
Describe your issue as precisely as possible :

  1. Steps to reproduce the issue or to explain in which case you get the issue
  • Just install on fresh expo sdk 51 project with new architecture
  1. Interesting logs
    ERROR Your app just crashed. See the error below.
    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.
    com.facebook.react.bridge.ReactContext.getJSModule(ReactContext.java:180)
    org.wonday.pdf.PdfView.onPageChanged(PdfView.java:98)
    com.github.barteksc.pdfviewer.listener.Callbacks.callOnPageChange(Callbacks.java:123)
    com.github.barteksc.pdfviewer.PDFView.showPage(PDFView.java:382)
    com.github.barteksc.pdfviewer.PDFView.jumpTo(PDFView.java:359)
    com.github.barteksc.pdfviewer.PDFView.loadComplete(PDFView.java:833)
    com.github.barteksc.pdfviewer.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:90)
    com.github.barteksc.pdfviewer.DecodingAsyncTask.onPostExecute(DecodingAsyncTask.java:27)
    android.os.AsyncTask.finish(AsyncTask.java:771)
    android.os.AsyncTask.-$$Nest$mfinish(Unknown Source:0)
    android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
    android.os.Handler.dispatchMessage(Handler.java:107)
    android.os.Looper.loopOnce(Looper.java:232)
    android.os.Looper.loop(Looper.java:317)
    android.app.ActivityThread.main(ActivityThread.java:8628)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
commented

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(SourceFile:21)
at org.wonday.pdf.a.e(SourceFile:86)
at y9.a.b(SourceFile:5)
at com.github.barteksc.pdfviewer.e.T(SourceFile:60)
at com.github.barteksc.pdfviewer.c.c(SourceFile:23)
at com.github.barteksc.pdfviewer.c.onPostExecute(SourceFile:3)
at android.os.AsyncTask.finish(AsyncTask.java:771)
at android.os.AsyncTask.-$$Nest$mfinish(Unknown Source:0)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:224)
at android.os.Looper.loop(Looper.java:318)
at android.app.ActivityThread.main(ActivityThread.java:8772)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:561)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

Its happening for me too