Interesting issue about Metamask provider

Hello,
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?
Thanks.

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