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

UnhandledPromiseRejectionWarning: Error: invalid json request [1.0.0-beta.47] #2447

Closed
imthatcarlos opened this issue Mar 4, 2019 · 3 comments · Fixed by #2451
Closed

UnhandledPromiseRejectionWarning: Error: invalid json request [1.0.0-beta.47] #2447

imthatcarlos opened this issue Mar 4, 2019 · 3 comments · Fixed by #2451
Labels
Bug Addressing a bug

Comments

@imthatcarlos
Copy link

As was mentioned briefly in this comment, eth.getAccounts() fails with the latest release of web3 and truffle-hdwallet-provider

Expected behavior

Code didn't change, only updated packages, and eth.getAccounts() should return accounts

Actual behavior

Fails.

Steps to reproduce the behavior

const Web3 = require('web3');
const HDWalletProvider = require('truffle-hdwallet-provider');
let provider = new HDWalletProvider(process.env.MNEMONIC, infuraNodeURL(false, network));
let web3 = new Web3(provider);
const accounts = await web3.eth.getAccounts();
// see error below

Error Logs

(node:31402) UnhandledPromiseRejectionWarning: Error: invalid json request
    at /Users/carlos/Desktop/helbiz/hbz-listen/node_modules/truffle-hdwallet-provider/dist/index.js:15:620862
    at e.i.onreadystatechange (/Users/carlos/Desktop/helbiz/hbz-listen/node_modules/truffle-hdwallet-provider/dist/index.js:15:775522)
    at e.t.dispatchEvent (/Users/carlos/Desktop/helbiz/hbz-listen/node_modules/truffle-hdwallet-provider/dist/index.js:1:152983)
    at e._setReadyState (/Users/carlos/Desktop/helbiz/hbz-listen/node_modules/truffle-hdwallet-provider/dist/index.js:15:780284)
    at e._onHttpResponseEnd (/Users/carlos/Desktop/helbiz/hbz-listen/node_modules/truffle-hdwallet-provider/dist/index.js:15:783369)
    at IncomingMessage.<anonymous> (/Users/carlos/Desktop/helbiz/hbz-listen/node_modules/truffle-hdwallet-provider/dist/index.js:15:782627)
    at IncomingMessage.emit (events.js:187:15)
    at IncomingMessage.EventEmitter.emit (domain.js:442:20)
    at endReadableNT (_stream_readable.js:1092:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Versions

npm: 6.8.0
node: v10.11.0
web3: 1.0.0-beta.47
truffle-hdwallet-provider: 1.0.5

@nivida nivida added Needs Clarification Requires additional input Bug Addressing a bug In Progress Currently being worked on and removed Needs Clarification Requires additional input labels Mar 4, 2019
@nivida nivida mentioned this issue Mar 4, 2019
12 tasks
@nivida nivida removed the In Progress Currently being worked on label Mar 5, 2019
@sydneyitguy
Copy link

I'm having the same issue with this.
Is there any work-around until beta.48 out?

@nivida
Copy link
Contributor

nivida commented Mar 5, 2019

@sydneyitguy I will release this fix today.

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

Successfully merging a pull request may close this issue.

4 participants