Web3 provider initialisation problem

import Web3 from "web3"; // Only when using npm/yarn

// Enable web3 and get the initialized web3 instance from Web3.js
await Moralis.enableWeb3();
const web3Js = new Web3(Moralis.provider);

OUTPUT: Argument of Type unknown is not assignable to type provider

Hi am trying to use web3 modules inside my app but I receive an error during initialization. Help me to resolve it

This returns web3/ethers directly

1 Like