Closed illuzen closed 2 years ago
Encountered the same problem. The only difference between (below) the first command (failed) and the second (success), is an extra space after "=" in the first command
truffle(develop)> msgHash = web3.sha3('\x19Ethereum Signed Message:\n' + message.length + message); TypeError: Cannot read property 'match' of undefined at parse (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:319624:13) at Function.Parser.detailed (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:320258:10) at parseArgs (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:322455:27) at Object.Yargs.self.parse (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:322081:18) at Command.getCommand (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:160684:24) at Console.interpret (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:202605:20) at ReplManager.interpret (/usr/local/lib/node_modules/truffle/build/cli.bundled.js:203345:18) at bound (domain.js:301:14) at REPLServer.runBound [as eval] (domain.js:314:12) at REPLServer.onLine (repl.js:468:10)
truffle(develop)> msgHash = web3.sha3('\x19Ethereum Signed Message:\n' + message.length + message); '0xa3cf95943562e78a694789d6ff02163344c42aa6e4495117eba9a9da6e60c866'
Is this still an issue on v5? Let us know! Thanks!
Yes it's still an issue. Below, the second command failed only because of an extra space after "=". Truffle version is
$ truffle version Truffle v5.0.1 (core: 5.0.1) Solidity v0.5.0 (solc-js) Node v8.10.0
truffle(develop)> msgHash = web3.utils.sha3('\x19Ethereum Signed Message:\n' + message.length + message);
'0xe28f5ff58ff3f1b24d6ba6e3b3e95e49589e8dd59b91296e76189d6ad2857b22'
truffle(develop)> msgHash = web3.utils.sha3('\x19Ethereum Signed Message:\n' + message.length + message);
TypeError: Cannot read property 'match' of undefined
at ReadStream.onData (readline.js:1011:36)
at emitKeys.next (<anonymous>)
at emitKeys (internal/readline.js:420:14)
at ReadStream.emit (events.js:214:7)
at emitTwo (events.js:126:13)
at ReadStream.onkeypress (readline.js:160:10)
at REPLServer.self._ttyWrite (repl.js:537:7)
at REPLServer.Interface._ttyWrite (readline.js:911:14)
at REPLServer.Interface._line (readline.js:631:8)
at REPLServer.Interface._onLine (readline.js:282:10)
at REPLServer.emit (events.js:211:7)
at emitOne (events.js:116:13)
at REPLServer.onLine (repl.js:468:10)
at REPLServer.runBound [as eval] (domain.js:314:12)
at bound (domain.js:301:14)
at ReplManager.interpret (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/repl.js:118:1)
at Console.interpret (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/console.js:138:1)
at Command.getCommand (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/lib/command.js:21:1)
at Object.Yargs.self.parse (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/~/yargs/yargs.js:532:1)
at Object.Yargs.self._parseArgs (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/~/yargs/yargs.js:938:1)
at Function.Parser.detailed (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/~/yargs-parser/index.js:761:1)
at parse (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-core/~/yargs-parser/index.js:125:1)
OK, this should be fixed now!
Issue
Not sure when this was introduced, but in the yargs-parser node module, we now break when double spaces are introduced between certain tokens, so
MultiSigWallet.new(web3.eth.accounts, 3 ).then(function(i){wallet = i})
is fine, butMultiSigWallet.new(web3.eth.accounts, 3 ).then(function(i){wallet = i})
throwsPrinting out args from yargs-parser.parse shows it is tokenizing funny
sorry I don't have time right now to debug further, it's not critical, just spent half an hour chasing it down. It might be an issue in yargs-parser?
to Reproduce
truffle console
(dev)> MyContract.new(args).then(function(i){ c = i})
Expected Behavior
just eat the extra space
Actual Results
trys to consume empty string as a token
Environment