Moralis.Web3.getAllERC20 is not a function

I’ve searched for this error and have seen a previous post here, but that seemed to relate to an issue that was fixed back in version .223, so I assume I have something different going wrong here?

I execute the following code in a cloud function:

    const options = { chain: 'bsc', address: '0x145D2fEa831f175E4A0aC73893466FD91EE67316' };
    const balances = await Moralis.Web3.getAllERC20(options);

And always receive this response:

{"code":141,"error":"Moralis.Web3.getAllERC20 is not a function"}

Any ideas?

Thank you!

1 Like

Hey @keyoke, hope you are ok.

Please follow this guidelines to check if the error can be solve there, if not, please follow the guidelines to share your code properly so we can help you review it.

Carlos Z

Thanks Carlos for the really quick reply. Great to have that guide, very useful.

I’ve worked through it and the first items aren’t relevant here (SDK etc) as this is a cloud function running on the server directly against BSC testnet. I’d already looked through the guides and my call uses the identical syntax. I had searched and found an issue in the forum that looked very similar but the resolution suggested was an upgrade to a server version that is now long since passed. There was no follow up on that item so I don’t know if the server version upgrade worked or the user worked around the problem in the end (as I am now preparing to do). In terms of screen shots there is not much to offer, I’m logging out the message shown above as the result of the call, and my server url is https://txrxagiqjwro.moralis.io:2053/server.

Thanks again.

This call works for me (version 0.0.235). For the testnet use chain: "bsc testnet", but this should not have caused an error.

The “not a function” error usually occurs when the Convenience Plugin is not installed. Please verify that this plugin is installed for the Moralis Server instance you are using:

To install the plugin follow the instructions in the docs here:
https://docs.moralis.io/plugins/intro

1 Like