ethereum-boilerplate / ethereum-react-native-boilerplate

The ultimate full-stack Ethereum React Native Dapp Boilerplate which gives you maximum flexibility and speed. Feel free to fork and contribute. Although this repo is called "Ethereum Boilerplate" it works with any EVM system! Happy BUIDL!👷‍♂️
MIT License
544 stars 286 forks source link

Moralis.onAccountChanged is not a function #46

Open socheat-leang opened 2 years ago

socheat-leang commented 2 years ago

I have cloned the project and done the yarn command successfully in order to load node_modules

Anyway, When I run the project, I met the error below. TypeError: Moralis.onAccountChanged is not a function. (In 'Moralis.onAccountChanged(function (address) { setWalletAddress(address[0]); })', 'Moralis.onAccountChanged' is undefined)

When I block this code, it can't make connect to wallet successfully.

The environment, I use the default from this boilerplate.

Do you have any suggestions or I miss some part? Please guide me in advance.

Thanks

alexnguyennz commented 2 years ago

Hi can you try changing that to Moralis.onAccountsChanged in the file at frontend/providers/MoralisDappProvider/MoralisDappProvider.js.

ohmygaugh-crypto commented 2 years ago

Hi can you try changing that to Moralis.onAccountsChanged in the file at frontend/providers/MoralisDappProvider/MoralisDappProvider.js.

Yup, I had the same issue and it was resolved with the suggestion above!

Silly typo

snehal-delixus commented 1 year ago

Hi have changed to Moralis.onAccountsChanged in the file at frontend/providers/MoralisDappProvider/MoralisDappProvider.js
but still i am getting error 404 on https://walletconnect.com/wallets and the popup with all the wallets is not shown

alexnguyennz commented 1 year ago

@snehal-delixus Hi can you post on the Moralis forum in this thread: https://forum.moralis.io/t/ethereum-react-native-boilerplate-questions/4511

BasitAlphaA commented 2 weeks ago

guys i have the same error as mentioned above TypeError: Moralis.onChainChanged is not a function

but i cant understand where this file exists as @alexnguyennz mentioned. @alexnguyennz can you guide me on this issue, it will be a grate help to me. THANKS

alexnguyennz commented 1 week ago

Hey your error is slightly different - in your terminal, it should show you the file and line where that code is being run. You can also do a project search with your IDE or code editor.