Interesting issue about Metamask provider

If there is no Metamask extension into the browser my React App shows only a blank page.
And this is the console error:

Error: missing provider (argument="provider", value=undefined, code=INVALID_ARGUMENT, version=providers/5.6.0)

But if there is an extension, app works perfectly.
And my website can’t seen on the mobile browsers too.
What should i do?

maybe you can check somehow if metamask extension is installed

I didn’t add “if there is no metamask dont display homepage” or something like that.
I’m confused, what should i do if metamask extension is installed or not? Can’t create the logic…

I think that there is an error generated somewhere in the code when it tries to access metamask and the webpage stops at that error and doesn’t display anything else because of that error

Post an example of your code - your app isn’t safely handling no available MetaMask or window.ethereum object for instance.

I figured out the problem and solved, thanks

1 Like

@blockchaindeveloper what was the problem?

from the looks of the error, MM is installed but there was like a contract instance (or something else) that wasnt property setup with the provider