Truffle: TypeError: Cannot read property 'id' of undefined

Created on 19 Jan 2019  路  6Comments  路  Source: trufflesuite/truffle

  • [x] I've asked for help in the Truffle Gitter before filing this issue.

Issue

Debug transaction of deploying "Proxy.sol" failed when using comand 'v' to print variables and values.

Steps to Reproduce

  1. migrate
truffle migrate --reset --network local
  1. debug
    debug the transaction of Proxy.sol deployment
truffle --network local debug '0x8c471e851ac5a4cba77a34c893f20034aa98350b13fc5e77f140eb53527b927d'
  1. print variables and values
v

Expected Behavior

print the variables and values

Actual Results

failed with error

Proxy.sol:

2: import { AuthModule } from "./Module/AuthModule.sol";
3:
4: contract Proxy {
   ^^^^^^^^^^^^^^^^

debug(local:0x8c471e85...)> i

Proxy.sol:

18:     }
19:
20:     constructor(address authModule) public {
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

debug(local:0x8c471e85...)> v
TypeError: Cannot read property 'id' of undefined
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:28:1
    at step (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/babel-runtime/helpers/asyncToGenerator.js:17:1)
    at Generator.next (<anonymous>)
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:3135:1
    at Session.view (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:3031:1)
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:36:1
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:86:1
    at args (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect-tree/index.js:209:1)
    at Function.<anonymous> (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:36:1)
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:86:1
    at args (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect-tree/index.js:209:1)
    at Function._ (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:36:1)
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:86:1
    at args (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect-tree/index.js:209:1)
    at Function._ (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:36:1)
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:90:1
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:36:1
    at /Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/~/reselect/lib/index.js:76:1
    at data.info.scopes._ (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:1686:125)
    at Array.map (<anonymous>)
    at map (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:1701:1)
    at Array.filter (<anonymous>)
    at newScope.variables.concat.filter.variable (/Users/wxl/.npm-global/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:1701:1)

Environment

  • Operating System: macos mojave
  • Ethereum client: 1.8.19-stable
  • Truffle version (truffle version): v5.0.2 (core: 5.0.2)
  • node version (node --version): v8.9.4
  • npm version (npm --version): 6.1.0

Other

Debugger

Most helpful comment

I experienced the same issue, on NixOS:

  • truffle version ~ v5.0.2 (core: 5.0.2)
  • node --version ~ v10.12.0
  • npm --version ~ 6.4.1
  • Using Etherlime for tests

See gist for logs: https://gist.github.com/BenSchZA/6d115be7a4547ddf587f91ab1dbd3c98

By downgrading to Truffle v5.0.0 the issue no longer occurs. I can successfully print variables and values without the above error @wxlcat

@gnidan I discussed this issue briefly with you on Gitter. Decided yesterday to work my way through the versions to see if it was version specific.

All 6 comments

Thanks for the thorough issue documentation!

cc @haltman-at

I experienced the same issue, on NixOS:

  • truffle version ~ v5.0.2 (core: 5.0.2)
  • node --version ~ v10.12.0
  • npm --version ~ 6.4.1
  • Using Etherlime for tests

See gist for logs: https://gist.github.com/BenSchZA/6d115be7a4547ddf587f91ab1dbd3c98

By downgrading to Truffle v5.0.0 the issue no longer occurs. I can successfully print variables and values without the above error @wxlcat

@gnidan I discussed this issue briefly with you on Gitter. Decided yesterday to work my way through the versions to see if it was version specific.

@BenSchZA Thanks buddy.

By the way, Truffle 5.x.x no longer print transaction hash of contracts method calling except contract deployment in migration. Do you know how to make it print all transaction hash? It cumbersome to manually print it.

i got this error today. it would have been easier to debug if failed contract calls printed the transaction hash. it was kind of awkward that i have to use something else (geth, ganache) to find the transaction hash. truffle should cover steps from error --> debug

Whoops, this kind of slipped off my radar! Fortunately, I think we might have already fixed this. This seems to resemble issue #1752, which is solved by PR #1779. And indeed when I try it right now on develop, where #1779 has been merged in, I'm not getting this problem. Could you try it again once the new version of Truffle Debugger is out and see if you're still getting the problem? Thanks!

Closing this. Please try upgrading Truffle via the following:

npm uninstall -g truffle
npm install -g truffle

and let us know if the problem persists. Thanks again!

Was this page helpful?
0 / 5 - 0 ratings