wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.59k stars 545 forks source link

`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method #859

Open jeppe-smith opened 1 month ago

jeppe-smith commented 1 month ago

What react-native version are you using? 0.74.5 What react-native-pdf version are you using? 6.7.5 What platform does your issue occur on? (android/ios/both) ios Describe your issue as precisely as possible : I have upgraded a project from 73 to 74 bridge less and now this error is showing in my logs. I have pinned it down to this library. When I remove the import of react-native-pdf I don't get the warning. Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

<Pdf
        trustAllCerts={false}
        source={source}
        onLoadComplete={(numberOfPages, filePath) => {}}
        onPageChanged={(page, numberOfPages) => {}}
        onError={(error) => {}}
        onPressLink={(uri) => {}}
        style={styles.pdf}
/>
SwhiteMHC commented 1 month ago

I am also encountering this issue. My react-native and react-native-pdf versions match @jeppe-smith. Commenting the component removes the error.

RaafatDev commented 1 week ago

I hade the same error message. I am using Expo in my project with the same package versions you described.

in my case after following the documentation instructions described in config-plugins/react-native-pdf repo: https://github.com/expo/config-plugins/tree/main/packages/react-native-pdf

  1. install all the required packages npx expo install react-native-pdf react-native-blob-util @config-plugins/react-native-pdf @config-plugins/react-native-blob-util

  2. add the plugins in app.json file

    {
    "plugins": [
    "@config-plugins/react-native-blob-util",
    "@config-plugins/react-native-pdf"
    ]
    }
  3. rebuild my app (in my case creating new custom build with eas build)

everything worked again without any errors or issues 👍