Closed siddharthlatest closed 6 years ago
React native doesn't run in a node environment. Possibly that's why we won't be able to require
and use http
and https
which are core node modules. Did some finding on this and according to the docs RN suggests using fetch
or some other 3rd party like axios
. Also this post on SO.
Perhaps a possible workaround could be to use fetch
IMO.
But isn't hyperquest being used internally by appbase. Wouldn't using fetch require a rewrite?
On Jul 7, 2017 21:45, "Divyanshu Maithani" notifications@github.com wrote:
React native doesn't run in a node environment. Possibly that's why we won't be able to require and use http and https which are core node modules. Did some finding on this and according to the docs https://facebook.github.io/react-native/docs/network.html RN suggests using fetch or some other 3rd party like axios. Also this https://stackoverflow.com/questions/29371694/react-native-and-requirehttp post on SO.
Perhaps a possible workaround could be to use fetch IMO.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/appbaseio/appbase-js/issues/23#issuecomment-313726507, or mute the thread https://github.com/notifications/unsubscribe-auth/AGP5tAyGkv0BXzBU9EKqsmDjGmUMZjZfks5sLlmQgaJpZM4OQ8-1 .
I haven't looked into the codebase for appbase-js so I'm not sure on this
We have moved to fetch
based request in v2.
v2.0.0-alpha-03
works with react-native.
When trying to use appbase-js with react native. It will not install correctly as the dependency hyperquest depends on http and https node modules. There are also modules with this name include with react-native.
Investigate into confirming the issue and finding work arounds to this.