wagmi icon indicating copy to clipboard operation
wagmi copied to clipboard

useContractRead returns abi.map is not a function. While useContractReads works.

Open RielJ opened this issue 4 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Package Version

^0.5.1

Current Behavior

useContractRead Function returns TypeError: abi.map is not a function.

Expected Behavior

while useContractReads Successfully returns the said data. Which is the expected returned value with the same input arguments as useContractRead

Steps To Reproduce

  const contract = {
    addressOrName: address,
    contractInterface: abi
  };

  const { data: borrowBalance } = useContractRead({
    ...contract,
    functionName: "borrowBalanceStored",
    args: address,
    chainId: chainId,
  });

  const { data } = useContractReads({
    contracts: [
      {
        ...contract,
        args: address,
        functionName: "borrowBalanceStored",
        chainId: chainId,
      },
    ],
  });

RielJ avatar Aug 25 '22 14:08 RielJ

Thanks for reporting. This issue is temporarily closed due to lack of information. Please provide a minimal reproducible example via a CodeSandbox (feel free to use this template) and reopen this issue. Other information is also helpful, like framework (e.g. Next.js), browser, etc.

jxom avatar Aug 25 '22 20:08 jxom

I got the same error while using useContractWrite function. Why is there no solution to this?

realsbd avatar Dec 04 '22 09:12 realsbd

@realsbd We need a minimal reproducible example to look into it more. Feel free to add one.

tmm avatar Dec 04 '22 15:12 tmm

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 other comments you can create a new discussion.

github-actions[bot] avatar Jan 14 '24 00:01 github-actions[bot]