When a solidity smart contract reverts with a message due to a failure on a require statement, the browser calling the smart contract returns "Error: VM Exception while processing transaction: revert". However, it does not show the message associated with the require statement.

I am using Truffle v5.0.1 (Solidity v0.5.0 and Node v11.6.0).

Is there a way to get this message in the browser?

1 Answer 1


Revert reason strings are a new-ish addition, and a big part of the ecosystem still has no support for it. Currently, the only way to get the reason string is by using the latest versions of ganache-cli with the latest versions of Truffle.

I don't know if Metamask has support to display it in the browser [citation needed], but you should be able to catch it in your code and do a console.log().

  • 2
    I updated ganache-cli also, and it now works :) Thanks Jan 8, 2019 at 13:28
  • yes updating ganache really works Sep 14, 2019 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.