MetaMask nonce error in the dev environment
Cause: Every time the dev environment starts, it creates a new local test chain. MetaMask caches the latest block number and the account transaction nonce. Because eachdev run creates a fresh chain, the cached values no longer match the new chain state, causing transactions to fail.
Solution: Clear the MetaMask account activity cache by following the MetaMask documentation.
MetaMask nonce error when using --reset-on-change
Cause: The --reset-on-change option resets the blockchain on every code change. After a reset, the block number and account nonce return to their initial values, but MetaMask does not clear its cache automatically.
Solution: Clear the MetaMask account activity cache by following the MetaMask documentation.