eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

EOSJS - ReactNative -- undefined is not an object (evaluating 'self.fetch')

Open amolmaid opened this issue 8 years ago • 4 comments

Hi, I have been following instructions from link https://github.com/EvaCoop/eosjs-react-native , to setup eosjs on already-build react-native app. I have installed related dependencies as well like react-native-browser-polyfill and react-native-hockeyapp

My build completes successfully and runs fine But I am facing following error when I open my app in mobile. undefined is not an object (evaluating 'self.fetch')

Kindly guide for the same.

amolmaid avatar Sep 24 '18 07:09 amolmaid

eosjs-api uses npm package isomorphic-fetch 2.2.1https://github.com/matthew-andrews/isomorphic-fetch

I don't see any RN issues .. When you create eosjs it tries to check the chainId and warn if it does not match. That is the first time it tries to fetch.

jcalfee avatar Sep 24 '18 11:09 jcalfee

Currently I don't have any dependency for isomorphic-fetch in my package.json, so do I need to import it explicitly? uptil now I didn't write any code yet which uses eosjs, I just installed and imported eosjs and this error flagged.

amolmaid avatar Sep 24 '18 11:09 amolmaid

You may need a RN version .. I don't know. Make sure you have a question opened in the EvaCoop/eosjs-react-native repository.

jcalfee avatar Sep 24 '18 15:09 jcalfee

Sure I'll thanks, for direction. :)

amolmaid avatar Sep 24 '18 15:09 amolmaid