trufflesuite / truffle-debugger

Core functionality for debugging Solidity files built with Truffle
67 stars 12 forks source link

Web3ProviderEngine does not support synchronous requests. #79

Open bugduino opened 6 years ago

bugduino commented 6 years ago

Hi I was experiencing an issue related to this one https://github.com/trufflesuite/truffle-debugger/issues/51

and now after updating to the latest version of next channel (which should have this https://github.com/trufflesuite/truffle/pull/1371 merged) I'm now getting the following error when trying to debug a transaction

Gathering transaction data...

Error: Web3ProviderEngine does not support synchronous requests.
    at Web3ProviderEngine.send (/home/foobar/Projects/test-project/node_modules/web3-provider-engine/index.js:75:9)
    at HDWalletProvider.send (/home/foobar/Projects/test-project/node_modules/truffle-hdwallet-provider/index.js:54:27)
    at HDWalletProvider.send (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:95:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:5156:1
    at new Promise (<anonymous>)
    at new F (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/core-js/library/modules/_export.js:36:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:5155:1
    at Generator.next (<anonymous>)
    at step (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:17:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:35:1
    at new Promise (<anonymous>)
    at new F (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/core-js/library/modules/_export.js:36:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:14:1
    at Web3Adapter.getTrace (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:5168:6)
    at runCallEffect (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:513:1)
    at runEffect (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:435:358)
    at next (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:315:1)
    at proc (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:270:1)
    at runForkEffect (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:554:1)
    at runEffect (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:435:492)
    at next (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:315:1)
    at currCb (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:388:1)
    at takeCb (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:466:58)
    at Object.put (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:73:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:161:1
    at Array.<anonymous> (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:182:1)
    at Object.emit (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:26:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/middleware.js:67:1
    at dispatch (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux/es/applyMiddleware.js:35:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/utils.js:250:1
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:489:1
    at exec (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/scheduler.js:19:1)
    at flush (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/scheduler.js:60:1)
    at asap (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/scheduler.js:33:1)
    at Array.<anonymous> (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:185:11)
    at Object.emit (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:26:1)
    at Object.dispatch (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/middleware.js:67:1)
    at new Session (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:2354:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:2202:1
    at Generator.next (<anonymous>)
truffle(live)> TypeError: Cannot read property 'view' of undefined
    at printAddressesAffected (/home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/commands/debug.js:111:1)
    at /home/foobar/.asdf/installs/nodejs/9.11.2/.npm/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/commands/debug.js:451:1
    at <anonymous>

This is my truffle-config.js file

'use strict';
require('dotenv').config();
const HDWalletProvider = require("truffle-hdwallet-provider");
const INFURA_KEY = process.env["INFURA_KEY"];

module.exports = {
  solc: {
    optimizer: { // Turning on compiler optimization that removes some local variables during compilation
      enabled: true,
      runs: 200
    }
  },
  networks: {
    local: {
      host: 'localhost',
      port: 9545,
      gas: 5000000,
      network_id: '*'
    },
    live: {
      provider() {
        return new HDWalletProvider(process.env["MAINNET_MNEMONIC"], `http://localhost:8545`);
      },
      gas: 2612388,
      gasPrice: 4000000000, // 4 gwei
      network_id: 1
    }
  }
};
> truffle version
Truffle v5.0.0-next.12 (core: 5.0.0-beta.0)
Solidity v0.4.24 (solc-js)
truffle console --network live
truffle(live)> web3.version
'1.0.0-beta.35'

any ideas?

CherryDT commented 4 years ago

Same problem here!

$ truffle version
Truffle v5.1.28 (core: 5.1.28)
Solidity v0.5.16 (solc-js)
Node v12.10.0
Web3.js v1.2.1