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

Cannot Read propertly getDocumentsDirectory of undefined in IOS only #62

Open
Rahish opened this issue Jan 15, 2020 · 16 comments
Open

Cannot Read propertly getDocumentsDirectory of undefined in IOS only #62

Rahish opened this issue Jan 15, 2020 · 16 comments

Comments

@Rahish
Copy link

Rahish commented Jan 15, 2020

anyone can help me solve it ?

@thekevinbrown
Copy link
Collaborator

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?

@vrautgit
Copy link

vrautgit commented Mar 5, 2020

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

@jonathanroze
Copy link

Same for me and it's well linked

@thekevinbrown
Copy link
Collaborator

A reproduction would help us troubleshoot it. This is working in my projects so it's hard to tell what the issue could be.

@EricWiener
Copy link

EricWiener commented Apr 5, 2020

Same issue here. Just copy and pasted the example code. I installed with:

yard add react-native-pdf-lib
cd ios && pod install

@costvin15
Copy link

costvin15 commented Apr 6, 2020

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')

@EricWiener
Copy link

@costvin15 I’d recommend using pdf-lib. It works perfectly for me with no native dependencies.

@costvin15
Copy link

Thanks @EricWiener, I will search on. I am now using react-native-html-to-pdf and it is serving me well.

@thekevinbrown
Copy link
Collaborator

@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.

@lylest
Copy link

lylest commented May 6, 2020

facing the problem in android not ios

@ivanstnsk
Copy link

Same in iOS. It looks like there is an issue with auto-linking in React Native 0.60+

@thekevinbrown
Copy link
Collaborator

I'm using this library on React Native 59, and would welcome a PR to support auto-linking for 60+.

@venkat-waran
Copy link

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?

@thekevinbrown
Copy link
Collaborator

@venkat-waran when someone either creates a new PR to solve the issue, or takes ownership of getting #65 over the line.

@tgreco
Copy link

tgreco commented Dec 28, 2020

This issue is still happening.

@neha-11111
Copy link

Possible Unhandled Promise Rejection (id: 0): TypeError: Cannot read property 'getDocumentsDirectory' of null how to resolve this

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