Mumbai : "unsupported getDefaultProvider network"

I try to test my code for Polygon network on the testnet Mumbai.
When I change my settings from Kovan to Mumbai using Infura, I face this error message : “unsupported getDefaultProvider network”.
No problem on Kovan, it works as I expect to.
Do you know what can be the problem ?

import { ethers } from "ethers";
const fs = require("fs");
const mnemonic = fs.readFileSync(".secretMnemo").toString().trim();
let path = "m/44'/60'/0'/0/1";
const wallet = ethers.Wallet.fromMnemonic(mnemonic, path);
const infuraKeyMumbai = fs.readFileSync(".secretInfuraKeyMumbai").toString().trim();
const provider = ethers.getDefaultProvider('mumbai', {
    infura: "" + infuraKeyMumbai

Error :
reason: ‘unsupported getDefaultProvider network’,
operation: ‘getDefaultProvider’,
network: ‘mumbai’

Thanks for your help!

I respond to myself in case it can help someone:
The Ethers default provider does not currently support Mumbai.
For now the easiest thing to do is either register with INFURA for your own polygon-enabled account and use the InfuraProvider.

1 Like