-
Notifications
You must be signed in to change notification settings - Fork 61
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
Error with React Native: main
module field does not exist
#211
Comments
I just came across this problem yesterday too! In this issue, the snippet in this exact post solved the problem. Though later I found that react-native doesn't work with I had to revert back to using https://www.npmjs.com/package/prismic-javascript which works pretty well. Actually if anyone from prismic reads this, do you plan to make |
Hi @lyqht and @Brianzchen, thanks for reporting this (and posting a solution @Brianzchen). I work at Prismic and maintain this library.
It's unfortunate that URLSearchParams is not fully supported in React Native since it is used heavily in the library to build the Prismic API URLs. For web and Node.js usage, using the native URLSearchParams is preferred over a third-party search params library to minimize the bundle size. While I don't see Specifically regarding the URLSearchParams limitation, a polyfill can be added to your app:
Source: facebook/react-native#23922 (comment) Regarding |
This should be fixed as of You can install To be clear, adding the URLSearchParams polyfill in your app is still necessary for I was unable to get React Native running without Expo so I did not test it with non-Expo React Native app. If someone is able to test with vanilla React Native, I would greatly appreciate it! I'm going to close this issue as it should be resolved, but please let me know if this is still not working and I will take another look. Thank you! |
Thanks! If not done so some details with compatibility to react native would be helpful for future users in the readme |
@Brianzchen Great suggestion. There isn't a mention in the docs right now, but I will work on getting something added. React Native-specific installation will most likely be added to this page: https://prismic.io/docs/technical-reference/prismicio-client?version=v6 |
Just following up - A note has been added to the docs specifically regarding React Native setup. https://prismic.io/docs/technical-reference/prismicio-client?version=v6#installation |
Versions
Reproduction
Here's a sample repository if you would like to replicate the problem.
Problem
Got the following error
I have tried modifying the metro.config.js by following the StackOverflow Thread
but I'm still encountering the same error. I've looked at the the closest issue on the deprecated repository but it's not the same problem.
Any help will be appreciated!
The text was updated successfully, but these errors were encountered: