How do I resolve : TypeError: undefined is not an object (evaluating '_bip.default.generateMnemonic')

Viewed 78

I'm working on a mobile application and I need to use bip39 in order to generate a passphrase, after installing the package some errors of the following missing packages popped out : stream buffer events, after installing everything, I came across this error :

[TypeError: undefined is not an object (evaluating '_bip.default.generateMnemonic')]

Here is how I'm using bip39 :

import bip39 from 'bip39'
export default function NewAccount({ navigation }) {

const handleSubmit = async () => {
try {
  let seed = await bip39.generateMnemonic(256) // default to 128
  console.log(seed)
  return seed
   } catch(e) {
  console.log(e)

  }
 navigation.navigate("Passphrase")
 }
}

How can I resolve this issue ?

0 Answers
Related