Open rphansen91 opened 3 years ago
Hi, i had the same behavior.
The workaround for this is install crypto-browserify and add a kind of rewrite rule in your babel config.
npm i crypto-browserify
and my babel.config.js is
`module.exports = function (api) {
api.cache(true);
const presets = [
'babel-preset-expo',
];
const plugins = [ ['module-resolver', moduleResolverConfig], ["babel-plugin-rewrite-require", { "aliases": { "crypto": "crypto-browserify" } }] ];
return { presets, plugins }; };` But you will face another issue i didn't find any solution yet: one of the dependencies of moralis requires the nodejs fs lib which of course doesn't work with React native....
InternalError Metro has encountered an error: While trying to resolve module
fsfrom file ...node_modules/@elrondnetwork/erdjs/out/smartcontracts/code.js
So im still stuck too...
@rphansen91 were you able to find a solution? I'm having the same issue and I'm using Expo React Native.
React Native official support coming soon we will share boilerplate and tutorials hopefully next week
@ivan-liljeqvist Any news with the boilerplate and tutorials?
@dannyhchan https://youtu.be/FRilwynjW1c
@ivan-liljeqvist the repo doesn't have the .env.example file. What are the list of environment variables are needed?
https://forum.Moralis.io for all questions and discussions please
I tried to install moralis for react native as described here https://www.npmjs.com/package/moralis But then I get the error message "Unable to resolve module crypto from D:\Programming\ReactNative\theCollector\node_modules\web3-eth-accounts\lib\index.js:"
Need to import https://www.npmjs.com/package/web3-react-native if react native