Cannot import Ethereum web3.js in React Native application

vivekellappenvivekellappen Member Posts: 3
I'm trying to import the Ethereum web3.js library into a React Native project.


  • vivekellappenvivekellappen Member Posts: 3

    I've resolved this by editing line 2677 of the file /node_modules/bignumber.js/bignumber.js as follows:

    -if ( !crypto ) try { crypto = require('crypto'); } catch (e) {}
    +if ( !crypto ) try { crypto = require('crypto-js'); } catch (e) {}

    So it would appear this appear this could be an issue with the bignumber.js dependency, or the way it's being imported. I'm unable to open issues on their GitHub repo so posting here.
Sign In or Register to comment.