I’m building a normal React project (not related to blockchain, crypto, or MetaMask).
However, Chrome gives this uncaught error in the console:
Failed to connect to MetaMask
at Object.connect (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/inpage.js)
The strange part:
My app does NOT use Web3, ethers, crypto libs, or MetaMask.
Opera browser works fine.
I’m not calling
window.ethereumanywhere.MetaMask is installed on Chrome, but I don’t want it to interfere.
The error happens on page load or during hot reload.
I suspect that one of my dependencies might be checking for window.ethereum, and Chrome MetaMask auto-injects inpage.js, causing a connection attempt that fails.
My question:
Why does Chrome MetaMask auto-inject into non-crypto projects and cause this error?
Which libraries commonly trigger this?
How can I completely disable or sandbox MetaMask injection ONLY for my local dev site or only for this project?
Any help or debugging ideas are appreciated.