react-native-pdf-lib
react-native-pdf-lib copied to clipboard
Cannot Read propertly getDocumentsDirectory of undefined in IOS only
anyone can help me solve it ?
This sounds like the module isn't correctly linked.
https://facebook.github.io/react-native/docs/linking-libraries-ios
Can you follow the steps there and let me know if you're still having trouble?
I got the same issue. Followed manual linking steps on react-native documentation. The issue is still there.
Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot read property 'getDocumentsDirectory' of undefined
Same for me and it's well linked
A reproduction would help us troubleshoot it. This is working in my projects so it's hard to tell what the issue could be.
Same issue here. Just copy and pasted the example code. I installed with:
yard add react-native-pdf-lib
cd ios && pod install
Same for me. I installed it this way:
yarn add react-native-pdf-lib
cd ios
pod install
I am getting TypeError: null is not an object (evaluating '_reactNativePdfLib.default.getDocumentsDirectory')
@costvin15 I’d recommend using pdf-lib. It works perfectly for me with no native dependencies.
Thanks @EricWiener, I will search on. I am now using react-native-html-to-pdf and it is serving me well.
@EricWiener, and @costvin15 I don't see the linking step there in the installation, which would cause this.
Ultimately if the PDFs you're using are small enough to be able to use the pure JS implementation then that's what I'd recommend too as having native modules adds complexity.
facing the problem in android not ios
Same in iOS. It looks like there is an issue with auto-linking in React Native 0.60+
I'm using this library on React Native 59, and would welcome a PR to support auto-linking for 60+.
I'm getting the same issue in IOS react-native": "0.62.2". When can we expect to fix this issue for the latest react native version?
@venkat-waran when someone either creates a new PR to solve the issue, or takes ownership of getting #65 over the line.
This issue is still happening.
Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot read property 'getDocumentsDirectory' of null how to resolve this