1
 const HDWalletProvider = require('truffle-hdwallet-provider');
 const Web3 = require('web3');
 const provider = new HDWalletProvider( 'passphrase', 'rinkeby.infura.io/v3/mytoken' );
 const web3 = new Web3(provider);
 const deploy = async () =>{ const accounts = await web3.eth.getAccounts(); } deploy();

gives

TypeError:Cannot read property 'map' of undefined at GetAccountsMethod.afterExecution

versions used:

 "solc": "^0.4.24",
 "truffle-hdwallet-provider": "^1.0.4",
 "web3": "^1.0.0-beta.46" 

any solution woud be grateful. Thanks in advance.

  • You're gonna have to do a little more than that (share more code, and share more efforts made investigating this problem) if you're hoping to get help here. – goodvibration Feb 20 at 10:05
  • const HDWalletProvider = require('truffle-hdwallet-provider'); const Web3 = require('web3'); const provider = new HDWalletProvider( 'tomato rate sheriff course end labor topic above curious this rail group', 'rinkeby.infura.io/v3/ff9cefedf8924477a6d236e5e36fc06b' ); const web3 = new Web3(provider); const deploy = async () =>{ const accounts = await web3.eth.getAccounts(); } deploy(); – arun Feb 20 at 10:09
  • 2
    Are you sure it's a good idea to post those 12 words? – goodvibration Feb 20 at 10:18
  • raised : github.com/ethereum/web3.js/issues/2405 – Aniket Feb 21 at 17:36
  • 1
    downgrade it to 1.0.0-beta.36, it will work. – Aniket Feb 21 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.