I have updated Moralis SDK and react Moralis to the latest version, Since then enableWeb3() is not enabling web3 instance. I have tried reactMoralis’s enableWeb3() method and Moralis.enableWeb3(). Moralis.enableWeb3() throws an error “Cannot read properties of null (reading ‘on’)”.
if (!isWeb3Enabled && !isWeb3EnableLoading) {
Moralis.enableWeb3();
//enableWeb3({ provider: localStorage.getItem("provider") });
//Moralis.enableWeb3({ provider: localStorage.getItem("provider") })
}
React Moralis >> v1.0.4
Moralis >> v1.0.7
node >> v16.13.0
npm >> v8.1.0
Edit: enable web3 from react moralis is working perfectly.