0

I wanted to play around with web3modal (walletconnect) in typescript.

I followed the official guide, but was unable to finish my setup due to dependency problems

to reproduce simply run the following:

  1. npx create-react-app web3modal --template typescript
  2. cd web3modal
  3. npm install @web3modal/ethereum @web3modal/react wagmi viem
    initial problem screenshot

so I tried to solve it:

  1. npm i typescript@^5 (which results in warning shown below)
    warnings screenshot

  2. npm install @web3modal/ethereum @web3modal/react wagmi viem
    which results in more errors now, screenshot truncated more errors screenshot

I tried searching for a version of web3modal that uses typescript ^4, but after going down to 2.3.0 - it still sits at 5.0.4.

so my question is:
is there any react/typescript example that uses up to date versions of web3modal? and if not - what are the versions of web3modal/wagmi/viem that I can downgrade to to still use typescript 4.9.5?

edit: I'm aware that this exists, but it's missing the typescript part

1 Answers1

0

This is related to wagmi dep https://wagmi.sh/react/typescript

you'll need to run npm i --legacy-peer-deps

and for compile issues:

Try adding "skipLibCheck": true in the tsconfig.json file.

Glitch
  • 16
  • 1
  • thank you for your answer. I do have `skipLibCheck` set to `true`, but this happens (I believe at least) before we get to tsconfig. I'm not quite sure how this is all handled, but errors happen during `npm i`, I didn't get to `npm run build` where I think tsconfig would be used – Radek Domański Aug 04 '23 at 13:24
  • oh, you'll need to run `npm i --legacy-peer-deps` – Glitch Aug 04 '23 at 14:19
  • that did help indeed, thanks. just please add this to your main response, so others can see it as well :) I'll accept it as is tho – Radek Domański Aug 09 '23 at 14:15