executeFunction issue in moralis 1.3.2

I’ve updated my react app to moralis 1.3.2 and react-moralis 1.3.1
I have updated my code as mentioned here. which states that

Return values are changed for Moralis.executeFunction and Moralis.transfer. They are now a transaction response from Ethers.js:

However, when I try to use executeFunction, and try to use the wait command, it gives me this error

Property 'wait' does not exist on type 'ExecuteFunctionResult'.

Where the function is declared and I How I invoke the function:

I think that there are specific hooks in react to do that, executeFunction is the function from vanilla JS

thanks. but it was working before the update

with what version of the sdk it was working?

these are the ones I’ve used before. thanks :slight_smile:

"moralis": "^0.0.152",
"react-moralis": "^0.3.1"

what do you have in res?

    "hash": "0x4e190db709904d0a62ba436f6b3df628ab80774f88eb704935f9ecbb3f555409",
    "type": 2,
    "accessList": null,
    "blockHash": null,
    "blockNumber": null,
    "transactionIndex": null,
    "confirmations": 0,
    "from": "0xD9002A1AdF3BcB3E31A06b06686ec56a8ACcb95C",
    "gasPrice": {
        "type": "BigNumber",
        "hex": "0x05d21dba00"
    "maxPriorityFeePerGas": {
        "type": "BigNumber",
        "hex": "0x05d21dba00"
    "maxFeePerGas": {
        "type": "BigNumber",
        "hex": "0x05d21dba00"
    "gasLimit": {
        "type": "BigNumber",
        "hex": "0x25c7cf"
    "to": "0xcCdBc0b01ed2fa0E5681091E578cDcAdC5C5D419",
    "value": {
        "type": "BigNumber",
        "hex": "0x00"
    "nonce": 295,
    "data": "0xf1f87ee600000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000d9002a1adf3bcb3e31a06b06686ec56a8accb95c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000067469676572320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000674696765723200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d556875686f637341696d564b4c783931354b3334446b353775664b6245515253597a3575516a6f57394b4e6f0000000000000000000000",
    "r": "0x5b1d1014492275b3db14b4f2410beea055f47d08e9e6aa6a5b2c50e4c027c2b3",
    "s": "0x18b032de1b7d60bbdcc5c3d786edc843ec962c50aca861f30ea8b8285ce08895",
    "v": 1,
    "creates": null,
    "chainId": 0

Apparently it’s an ethers object

what can you do with an ethers object?

it looks like it has some information about the transaction

it’s an ethersjs transaction response. to get the completed transaction with events and all, i need to call the wait() function and it’s not working as expected

it seems there is confusion on this blog about versions and apis. Im here from hours and seems either the examples are broken or people is using old packages.

   const transaction = await Moralis.executeFunction(options);
    const  receipt = await transaction.wait();

The transaction has no ‘wait’ method. In which Moralis version the wait method is implemented? in which documentation version is this method documented?

if i have to say… one of the worst documentation i ever found. Guess i need to start to consider web3js, this wrapper has too many problems, and lack of descritive logging for those errors.

1 Like

Hi @mastrobardo,

Could you specify what you’re trying to achieve. We try our best to solve all of your issues by answering queries 24/7. We would appreciate friendly cooperation while you pursue your developing endeavours.

To start,
The React executeFunction does not have a “wait” function on the transaction. The transaction only has wait operations when used in Vanilla JS.

Could you specify which part of the documentation got you confused with this so that we can follow up and make it clearer?


I had the same issue trying to execute a write function in react in all ways possible from the documentation but didn’t get it to work.

I ended up using ethers directly like so:

const provider = await Moralis.enableWeb3({ provider: "metamask" });
const ethers = Moralis.web3Library;
const signer = provider.getSigner();

const contract = new ethers.Contract(address, ABI, provider);

const transaction = await contract.connect(signer).mint();
const receipt = await transaction.wait();

It’s quite a few lines of code in comparison with the executeFunction but it has the advantage of working :slight_smile:

I came across that example in the Web3Provider documentation https://docs.moralis.io/moralis-server/web3/web3#example-of-calling-a-write-contract-method

If there is a better way of executing a write function let me know!