I started seeing this error recently, and not sure why.
My guess is… it is related to recent sdk upgrade.
Please suggest a solution.
This error was showing while running “Moralis.getChainId()”
I solved it by updating Moralis.getChainID()
with
window.ethereum.request({ method: 'eth_chainId' });
and again i started getting the same error while subscribing to queries. query.subscribe();
1 Like
or i could be wrong. I tried disabling the function and it is still happening.
These are the following things which i updated based on the ether.js thread.
- Updated cdn & unpkg paths
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
<script src="https://unpkg.com/moralis@latest/dist/moralis.js"></script>
- updated calling web3
Moralis.start({ serverUrl, appId });
async () => {
await Moralis.enableWeb3()
const web3 = Moralis.web3;
}
- And updated the way network /chain is tracked using
Moralis.switchNetwork
andwindow.ethereum.on("chainChanged", async(chain)
What else is remaining to change?
I don’t know, you can ask in that specific thread
1 Like