wevm / wagmi

React Hooks for Ethereum
https://wagmi.sh
MIT License
5.79k stars 968 forks source link

waitForTrasaction function is not working. #4057

Closed lucaslee129 closed 3 weeks ago

lucaslee129 commented 3 weeks ago

Check existing issues

Describe the bug

Hi, How are you? While working with functions on wagmi-core, I have one problem on waitForTransaction. In a one project, this function working differently. In the first case, this function working well. Here is codebase of that case.

const changeAddressHash = await writeContract({
        address: `0x${contractAddress}`,
        abi: seedRoundMMTAbi,
        functionName: "updateUserAddress",
        args: [sourceAddress, targetAddress]
      })

    await waitForTransaction({
      hash: changeAddressHash.hash
    })

But on other function, it is not working well and return the error. Here is code base and error message.

-Error message:

TransactionNotFoundError
    at getTransaction (getTransaction.js:58:15)
    at async delay.count.count (waitForTransactionReceipt.js:98:47)
    at async attemptRetry (withRetry.js:17:30)
------------------------------------------------------------------------------
TransactionNotFoundError
    at getTransaction (getTransaction.js:58:15)
    at async delay.count.count (waitForTransactionReceipt.js:98:47)
    at async attemptRetry (withRetry.js:17:30)

What is the reason of this error and how to fix this? Hope your kind support. Thanks

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

What Wagmi package(s) are you using?

@wagmi/core

Wagmi Version

1.4.1

Viem Version

1.10.9

TypeScript Version

5.0.4

Anything else?

No response

tmm commented 3 weeks ago

Recommend upgrading to wagmi@2

github-actions[bot] commented 6 days ago

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Wagmi version. If you have any questions or comments you can create a new discussion thread.