The code returns the following error:
Unhandled promise rejection: i: Failed to connect to MetaMask
Revise the code to address the error.
I was previewing: /