Hi. I had a 401 error while fetching NFTs, so one of the solution said I had to update react, reac-moralis and moralis. I did and I ended up with this:
TypeError: Moralis.onAccountsChanged is not a function
(anonymous function)
src/providers/MoralisDappProvider/MoralisDappProvider.js:14
11 | setChainId(chain);
12 | });
13 |
> 14 | Moralis.onAccountsChanged(function (address) {
| ^ 15 | setWalletAddress(address[0]);
16 | });
17 | // eslint-disable-next-line react-hooks/exhaustive-deps
TypeError: Moralis.onAccountsChanged is not a function
(anonymous function)
src/providers/MoralisDappProvider/MoralisDappProvider.js:14
11 | setChainId(chain);
12 | });
13 |
> 14 | Moralis.onAccountsChanged(function (address) {
| ^ 15 | setWalletAddress(address[0]);
16 | });
17 | // eslint-disable-next-line react-hooks/exhaustive-deps
Console logs:
./node_modules/magic-sdk/dist/es/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
./node_modules/magic-sdk/dist/es/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
./node_modules/moralis/lib/browser/Web3Connector/Web3AuthConnector.js
Module not found: Canât resolve â@web3auth/web3authâ in â/home/lautaro/nft/ethereum-boilerplate/node_modules/moralis/lib/browser/Web3Connectorâ
There is a post about this error but it isnât clear how to solve it.