How to fix MetaMask error: undefined is not an object
The following error message can occur in MetaMask:
Root TypeError: undefined is not a functionRoot TypeError: undefined is not an object
Before you reset your account, consult a member of the team by getting in touch with Support — resetting an account should be avoided where possible.
Before you reset your account
Make sure you have your Secret Recovery Phrase backed up before you reset your account, as well as the seed phrases or private keys of any imported accounts.
After resetting your account, your transaction history in MetaMask may default to none, which does not mean that your funds have been lost. MetaMask stores your transaction history locally, and this data may be erased when you reset an account. Remember that all transaction history is on the blockchain, and can be consulted on a block explorer.