question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'wordlists' of undefined

See original GitHub issue

Upgrading from 2.6.0 to 3.0.2 - nothing is accessible anymore through the following method (the one mentioned in the README):

import bip39 from "bip39"; // equivalent of const bip39 = require("bip39");

console.log(bip39.wordlists); // --> bip39 is undefined as it doesn't have a default export

It is however accessible by using:

import { wordlists } from "bip39";

console.log(wordlists);

or

import * as bip39 from "bip39";

console.log(bip39.wordlists);

Just an FYI as this change is quite breaking for some applications (including the ones I was working on) but it was nowhere documented

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
junderwcommented, Jul 26, 2019

import bip39 from “bip39”;

is equivalent to

const bip39 = require(‘bip39’).default

you want

import * as bip39 from “bip39”;

1reaction
junderwcommented, Jul 26, 2019

Also, the README states const bip39 = require('bip39')

The README does not state import bip39 from "bip39";

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'handleCorrectAnswers' of undefined ...
I get an TypeError: Cannot read property 'handleCorrectAnswers' of undefined error. this.handleCorrectAnswers = this.handleCorrectAnswers.bind( ...
Read more >
cannot read properties of undefined (reading '__h') - You.com
Your issue is that your .find() method is returning undefined, so you can't access properties on product such as .name as it is...
Read more >
bip39 - npm
When a checksum is invalid, warn the user that the phrase is not something generated by your app, and ask if they would...
Read more >
Custom edit mode generate eror: Uncaught TypeError
Custom edit mode generate eror: Uncaught TypeError: Cannot read property '$keywordList' of undefined ... callback(null, wordList.map(function(word) {.
Read more >
TypeError: Cannot read property 'voice' of undefined-discord.js
[Solved]-UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'voice' of undefined-discord.js ... It checks if the user is in any voice channel. If ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found