Cannot import Ethereum web3.js in React Native application

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

Comments

  • vivekellappenvivekellappen Posts: 3Member
    Fixed:

    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.


    https://github.com/ethereum/web3.js/issues/576.
Sign In or Register to comment.