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

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

Open
jeppe-smith opened this issue Aug 12, 2024 · 2 comments

Comments

@jeppe-smith
Copy link

jeppe-smith commented Aug 12, 2024

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
Copy link

SwhiteMHC commented Aug 20, 2024

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

@RaafatDev
Copy link

RaafatDev commented Sep 24, 2024

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"
  ]
}
  1. rebuild my app (in my case creating new custom build with eas build)

everything worked again without any errors or issues 👍

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

3 participants