undefined is not an object error when adding BIP39 to React Native

0

I have a React Native Project and it was worked correctly till I added bip39 package to the project. when i try to require bip39 in my component i get the below error.

undefined is not an object (evaluating 'superCtor.prototype')

inherits
inherits_browser.js:5:45
<unknown>
index.js:23:9
loadModuleImplementation
require.js:320:6
<unknown>
index.js:3:22
loadModuleImplementation
require.js:320:6
<unknown>
browser.js:3:17
loadModuleImplementation
require.js:320:6
<unknown>
index.js:2:24
loadModuleImplementation
require.js:320:6
<unknown>
BIP39.js:1:19
loadModuleImplementation
require.js:320:6
<unknown>
Mnemonic.js:5
loadModuleImplementation
require.js:320:6
<unknown>
App.js:5
loadModuleImplementation
require.js:320:6
<unknown>
index.js:7
loadModuleImplementation
require.js:320:6
guardedLoadModule
require.js:207:45
global code
<unknown file>:0

React Native Version 0.57.7

React Version 16.6.1

bip39 version 2.5.0

Amirhosein Rajabi

Posted 2019-02-04T08:16:06.180

Reputation: 1

Can you provide more information, like when is this error thrown?JBaczuk 2019-02-04T14:38:00.450

@JBaczuk when i add const bip = require('bip39') in componentAmirhosein Rajabi 2019-02-05T13:07:04.137

No answers