I'm attempting to verify the status of the network provided by metamask with web3.js by using web3.eth.net.isListening().then(console.log)

The method works when I'm connected. However, console displays the following error message when a false value is expected:

inpage.js:1 MetaMask - RPC Error: Error: JsonRpcEngine - response has no error or result for request:
  "jsonrpc": "2.0",
  "id": 3592343303,
  "method": "net_version",
  "params": [],
  "origin": "localhost"

If this is not supposed to work, is there another way to tell the application that the provider isn't listening to a network?

  • The "fake network" I'm using for this is a localhost connection that listens to a port that differs from the one that I'm using in my private network (which is Ganache).
  • My browser is Google Chrome.
  • My web3.js version is 1.0.0-beta.37

Your Answer

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

Browse other questions tagged or ask your own question.