question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] useContractReads always returning a [null]

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.5.5

Current Behavior

Trying to read one or multiple contracts using useContractReads always returns [null]

input:

import { erc721ABI, useContractReads } from 'wagmi';

[{
        addressOrName: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
        contractInterface: erc721ABI,
        functionName: 'tokenURI',
        args: 1,
        chainId: 1,
}]

Same object does succeed with useContractRead

image

Expected Behavior

No response

Steps To Reproduce

No response

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
matthewlilleycommented, Jul 1, 2022

I’ll fork your code sandbox and hard code the data so you can see there is defintiely an issue here.

1reaction
JohnSmithyycommented, Aug 22, 2022

For example here is my localchain setup (using rainbowkit):

const localChain: Chain = {
  id: 31337,
  name: "Local",
  network: "local",
  nativeCurrency: {
    decimals: 18,
    name: "Local",
    symbol: "ETH",
  },
  rpcUrls: {
    default: "http://127.0.0.1:8545/",
  },
  testnet: false,
  multicall: {
    address: "0x5ba1e12693dc8f9c48aad8770482f4739beed696",
    blockCreated: 12336033,
  },
};

This does not work at all. I have to remove the multicall param for things to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: useSigner() is always null for Metamask [v2.0.0-alpha.4 ...
When connected - atleast via metamask - useSigner() hook never returns a signer. This is needed for full adoption as the useContract/ ...
Read more >
In ES6, what is the syntax to specify an array for retrieving ...
I'm working with next.js, and this hook doesn't return the value ... the data property is not always defined, then you can use...
Read more >
useContractReads - wagmi
If a contract read fails while fetching, it will fail silently and not throw an error. import { useContractReads } from 'wagmi' function ......
Read more >
the above error occurred in the <img> component - You.com | The ...
The problem was that I downloaded the library not to the project itself, but to the project folder, which is why I had...
Read more >
Build an NFT Minting Page with thirdweb, IPFS, RainbowKit ...
import { useAccount, useContractRead, useContractWrite } from 'wagmi'; ... with erasure coding is always stored across a variety of geographic locations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found