Fixes for Solidity / JS / Metamask Errors

Hi everyone,
I had the idea to open a thread were we can post fixes to error message we encounter while working on our dApps. This might become very useful, as we can contribute answers here to build a kind of “Go-To-Resource” inside the academy forum, before we open a new topic, in case the topic does not exist yet.
I hope this makes sense. Let me think how you like this idea.

I couldn’t really decide where to put this topic, so I kept it MISC. Moderators, please move if inappropriate. Maybe we could have an own category for “Frequently Encountered Error Messages”?

1 Like

So here is my first fix:

When using Metamask with truffle develop, the problem of discrepancies in the transaction nonces might come up for you. This is, as my research showed, a quite common issue. You can do this to fix it:

NonceErrorMetamask

Source: How to reset Metamask Transaction History

Another one: ERROR Message “… is not a function”:

So either there really is no function in the contract that you want to use in javascript (main.js) or the issue here is, that the abi.js file, which passes all functions of the contract to the main.js, in form of a JSON object, is not up to date on the localhost. You can see this when checking the sources in the dev tools. Of course, make sure that your abi.js is up to date in your project files! You have to update it everytime you make changes to contract functions and remigrate!!
If it is up-to-date but still you get the error this could fix it:

ABIServerIssueSOLVED

When I found out I created this fix-pic (is that the right word? Haha) for you. Hope this helps!