wevm/abitype

Conflict with Typescript version

DJayFreshBlock opened this issue · 2 comments

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

0.1.8-0.2.5

TypeScript Version

4.6.4

Current Behavior

Multiple errors in index.d.ts trying to compile.

node_modules/abitype/dist/index.d.ts:77:66 - error TS1005: '?' expected. components: infer TComponents extends readonly AbiParameter[];

Expected Behavior

Type definitions shouldn't cause errors even in a version behind the project. Considering @wagmi/core TS is 4.6.4 also.

Link to Minimal Reproducible Example (TypeScript Playground)

No response

Steps To Reproduce

Inside Package.json

"dependencies": {
    "abitype": "^0.1.8",
    "typescript": "^4.6.4"
  }

test.ts

import { Address } from 'abitype';

export const address: Address = '0x';

run: tsc test.ts

Anything else?

I'm running into this issue while working inside of an Angular project which can't upgrade to TS 4.7+ at this time. I'm unable to use the below package due to the shared dependency of abitype:

  • @web3modal/ethereum

I pulled the repo down and moved back the typescript version to 4.6.4, re-compiled, and overwrote the dist folder in my project. That worked. I also tested with my example project having the typescript version to 4.7.4 with the compiled 4.6.4 dist folder and that also built.

So this is def. a backwards compatibility issue with 4.7 ts. I see some breaking changes around tuples which might be the cause.

tmm commented

ABIType supports versions 4.7.4 and above so 4.6.4 will not work unfortunately.