-
Notifications
You must be signed in to change notification settings - Fork 69
Error w/ React-native : unable to resolve module http #111
Comments
Hi, It's a known issue, the RN loader will load the modules even if they're in a conditional. I recommend you to use the compiled version in the meantime: |
Ok many thanks for the quick reply. Would you have a short usage example on how it works with Fetch ? P.S React being now more popular than JQuery, it would be great to have a specific kit (but I cant do it myself yet :-) |
You actually don't have to use Here is a React (not native) example, but it should work the same: |
Quite exactly what I needed (and nice code), thanks ! |
@erwan if I've got other teammates installing node_modules via npm, what's the best way to reference v3.2.0 so that I can utilize |
I found alw-react-native-prismic.io by @arnaudlewis which works with React Native! Hopefully that lib won't get shunned... |
A whole new version of the javascript-kit is close to be ready, it's designed to work in pair with the Prismic api v2 which handle default value to prevent null runtime exception. In this version, we will make sure that you can use it with react native out of the box. For this version of the kit, it can be consider to add support for react native but not in priority. |
Hi, I'm just hooking up Prismic to a RN project, and i wanted to check what is the currently recommended method of getting the SDK working with RN. I just installed prismic.io to my project and I am still getting the 'http' missing module error. Is the alw-react-native-prismic.io package mentioned above still the best way to get started? |
@scottbrassfield If you just started with prismic.io on this project, I suggest you to use the API V2 because you can manipulate the response as pure Json instead of calling functions from prototype like getImage etc. |
@arnaudlewis thanks for the quick response! I just replaced prismic.io with prismic-javascript in my project. If you could help me get started with API V2 that would be great, this is actually my first time using prismic.io in general so any help getting started with the API would be greatly appreciated. |
I'd be happy to help. |
Sounds great, just got the slack channel working, thanks! |
This issue is resolved by using the prismic.io API v2 with the prismic-javascript kit. |
I get a red screen when I try to require Prismic. It says
Unable to resolve module http from .../node_modules/prismic.io/lib/requests.js: Invalid directory /Users/node_modules/http
I'm reaching the API directly with Fetch but SDK would have been appreciated.
Edit: no better results with 2.1.0 (saw the release comment on react-native). Now it says :
I got rid of that but then got the same error as with 2.1.3. Did the dirty job...[error][tid:main] Unable to resolve module es6-promise from .../node_modules/prismic.io/lib/browser.js: Invalid directory /Users/node_modules/es6-promise
The text was updated successfully, but these errors were encountered: