MetaMask - RPC Error:


In my project, I tried to connect with metamask on Ganache. But I got the error like the following.

``` {code: -32602, message: "Expected an array with at least one valid string H…url 'rpcUrls', Received:\nhttp://", stack: '{\n "code": -32602,\n "message": "Expected an arra…gaeaoehlefnkodbefgpgknn/background-3.js:10:55314)'} ```

After querying, I believe that the rpc address should be in array format, but I have already done so,

``` rpcUrls: [''], ``` Please let me know how can fix it.
1 Like

Hey @wuyue, welcome to the MetaMask community! :fox_face:

You may be better off contacting Truffle support at


Ganache is private blockchain.
You are the validator node in it.
Try specifying localhost in your connection configuration:

module.exports = {
  contracts_build_directory: "./mydir/contracts",
  networks: {
    development: {
      host: "",
      port: 7545,
      network_id: "*"
  compilers: {
    solc: {
      version: "version" //  current actual version compiler 



This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.