I've installed Truffle by npm, and running testrpc, but console.log is not working in Truffle console. A simple console.log('test'); do nothing. Any idea?
[Ethereum] Truffle console.log is not working
consoletruffle
consoletruffle
I've installed Truffle by npm, and running testrpc, but console.log is not working in Truffle console. A simple console.log('test'); do nothing. Any idea?
Best Answer
I don't have a complete answer, but I believe it has to do with the console's automatic resolution of javascript promises. For example,
the truffle console will actually wait for the final .then promise to resolve and will then print
instance.contract
. That said, I would imagine thatwould work, or even
but they don't for me. I don't know enough about promises or the truffle console to understand why that doesn't work. Hopefully this gets fixed in the future. For now, you can do
or
as workarounds.