Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in getting accounts #2405

Closed
Aniket-Engg opened this issue Feb 21, 2019 · 3 comments
Closed

Error in getting accounts #2405

Aniket-Engg opened this issue Feb 21, 2019 · 3 comments

Comments

@Aniket-Engg
Copy link

Aniket-Engg commented Feb 21, 2019

Expected behavior

Return the list of accounts

Actual behavior

Error as below

Steps to reproduce the behavior

import Web3 from 'web3';
var HDWalletProvider = require("truffle-hdwallet-provider");
const web3 = new Web3(new HDWalletProvider(mnemonic, "https://ropsten.infura.io/v3/key"));
web3.eth.getAccounts().then(console.log);
web3.eth.personal.getAccounts().then(console.log); // Same error in both

Error Logs

(node:3442) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined
 at GetAccountsMethod.afterExecution (/Users/project/node_modules/web3-core-method/dist/web3-core-method.cjs.js:762:23)
at GetAccountsMethod._callee$ (/Users/project/node_modules/web3-core-method/dist/web3-core-method.cjs.js:457:39)
at tryCatch (/Users/project/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/Users/project/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (/Users/project/node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:114:21)
at asyncGeneratorStep (/Users/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/Users/project/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at <anonymous>

Versions

NPM : 6.7.0
Node.js: 11.10.0
web3 : 1.0.0-beta.46 & 1.0.0-beta.44

@nivida
Copy link
Contributor

nivida commented Feb 21, 2019

Thanks for creating this issue but it's a duplication of this issue #2266.

@nivida nivida closed this as completed Feb 21, 2019
@Aniket-Engg
Copy link
Author

Okay. I checked that and because of different error , raised this one. Thanks for the information.

@apurva121
Copy link

Hi @Aniket-Engg did you find the solution for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants