TypeError: Moralis.Web3.onAccountsChanged is not a function

I am using react-moralis with Next.js.
I have successfully installed all the necessary packages, however even though I have not called or used Moralis.Web3.onAccountsChanged in any of my scripts, when I run npm run dev , I am prompted with the following error ’ TypeError: Moralis.Web3.onAccountsChanged is not a function’. Some advice would be appreciated.

Moralis JS SDK v1.0 (migration to Ethers.js) Check this