-
Notifications
You must be signed in to change notification settings - Fork 574
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
TypeError: Cannot read properties of null (reading 'getConstants') #716
Comments
@albert17 Did you find a solution for this issue? |
Any solution import Pdf from 'react-native-pdf'; @testing-library/react-native |
Using with expo 48(react-native 0.71.4) same problem. With I get With ERROR: TypeError: Cannot read property 'DocumentDir' of null, js engine: hermes With ERROR TypeError: Cannot read property 'getConstants' of null, js engine: hermes Maybe problem is in react-native-blob-util and not in react-native-pdf? Searched and found this ticket: RonRadtke/react-native-blob-util#204 Original idea why it should work with expo: https://github.com/expo/examples/tree/master/with-pdf |
@kalinchuk Still facing same issue. I have tried mocking but no luck. |
Any update on that? Facing the same issue. |
Facing the same issue |
Same |
Some solution mentioned here, but have't tested. |
That's specifically for unit tests, while I'm observing this when running the app on an android simulator for realtime development. |
@mgithubmessier Did you add this line in
|
try but not working |
Facing the same |
For anyone running into this outside of tests in expo development builds, I ran into this today because I hadn't added the expo config plugins. Once I installed them and rebuilt the development build it all worked fine. |
jest.mock('react-native-pdf', () => { return () => <></>}) |
Thanks it works |
What
react-native
version are you using?0.69.3
What
react-native-pdf
version are you using?6.6.2
What platform does your issue occur on? (android/ios/both)
Both
Describe your issue as precisely as possible :
Run a test that imports PDF. Application runs fine, only
npm run test
fails.logs
Show us the code you are using?
The text was updated successfully, but these errors were encountered: