I'm building a DAPP it works fine when I host it from a server, but when the HTML file is local MetaMask gives this error:

MetaMask does not allow file:// protocol, use http(s)://

Any ideas what that means or if theres a way to get it to work? Thanks!


It's a browser security related thing, more can be found here.

The main excerpt:

Http(s) - Web Server Required

Due to browser security restrictions, we can't communicate with dapps running on file://. Please use a local server for development.

You have to start a local web server and access your HTML file from it.

  • if using vscode, using 'express host current workspace' will do the job – Roberto C. Nov 13 '18 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.