wagmi: bug: The isDataEqual option has been deprecated and will be removed in the next major version. You can achieve the same functionality by passing a function as the structuralSharing option

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.7.9

Current Behavior

The isDataEqual option has been deprecated and will be removed in the next major version. You can achieve the same functionality by passing a function as the structuralSharing option

This error/warning keeps spamming the console when I use useContractRead with watch enabled.

Expected Behavior

surpress/remove/solve this warning/error.

Steps To Reproduce

No response

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

No response

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 19
  • Comments: 18 (5 by maintainers)

Most upvoted comments

Hi @tmm, here are steps to reproduce, let me know if I can add any more information. Thanks for looking at this. I’m having a blast building with wagmi 😃

npm init @rainbow-me/rainbowkit@latest

in pages/_app.tsx:

comment out alchemyProvider so it doesn’t trigger no network error

in pages/index.tsx:

add imports

import { useContractRead } from 'wagmi';
import ERC721 from '<PATH TO OPEN ZEPPELIN>/@openzeppelin/contracts/build/contracts/ERC721.json'

under const Home: NextPage = () => { add

const { data: somedata } = useContractRead({
    addressOrName: '0x5d2BF3b4264EFADE95fC89348f1367fCa0552861',
    contractInterface: ERC721.abi,
    functionName: 'ownerOf',
    args: [111],
    watch: true,
  })

^ these are arbitrary NFT contract and ID, in this case Starkade

npm run dev

and navigate to app, it should trigger a flood of:

Screen Shot 2022-11-03 at 6 07 06 PM

If you’re using pnpm, you can add this to package.json

"pnpm": {
    "overrides": {
      "@tanstack/query-sync-storage-persister": "4.13.4",
      "@tanstack/react-query": "4.13.4",
      "@tanstack/react-query-persist-client": "4.13.4"
    }
  }

Thanks @tmm. It’s only happening on my local instance, disappears when I build and deploy. Using NextJS 12 - will try to make a minimal repro later today if I get a chance.