I'm trying to call a function contract from web3. The web3 provider is metamask and the metamask popup opens up when it should however when I click confirm I just see a loader and nothing happens. When I click away and open metamask again, it just says that the transaction is approved but not confirmed. The code I'm using is pretty much exactly whats in the docs. Why is this happening?
The problem might be related to metamask history.
Try following this guide: https://metamask.helpscoutdocs.com/article/36-resetting-an-account
If you're using local ganache-cli o similiar things such as testrpc restart those and change network Id.
This bug might lead to blank metamask too, https://github.com/MetaMask/metamask-extension/issues/1999.