Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any plans for @ethersproject/units to support TS 4.1.x #1288

Closed
glomotion opened this issue Feb 10, 2021 · 9 comments
Closed

Is there any plans for @ethersproject/units to support TS 4.1.x #1288

glomotion opened this issue Feb 10, 2021 · 9 comments
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@glomotion
Copy link

glomotion commented Feb 10, 2021

We're currently trying to use @ethersproject/units (5.0.10) inside a react project which is built using a new version of TS:

"typescript": "^4.1.3",

currently, when trying to compile, we get the following type error from tsc:

node_modules/@ethersproject/experimental/lib/nonce-manager.d.ts:7:9 - error TS2611: 'provider' is defined as a property in class 'Signer', but is overridden here in 'NonceManager' as an accessor.

7     get provider(): ethers.providers.Provider;
          ~~~~~~~~

Found 1 error.

I've noticed that typescript 3.x is listed as a dev dependency for this repo:

"typescript": "3.8.3",

Just wondering if anyone else slammed into this?
If not, are there any plans to support newer TS installations?

@glomotion glomotion changed the title Is there any plans to get @ethersproject/units to support TS 4.1.x Is there any plans for @ethersproject/units to support TS 4.1.x Feb 10, 2021
@ricmoo
Copy link
Member

ricmoo commented Feb 10, 2021

I’m working on v6 right now which uses the latest greatest TS.

I don’t mind bumping the version up for v5 too though. I just need to communicate it because TS does make changes like this that can break people...

I’m surprised I haven’t ran into the above problem myself...

@ricmoo ricmoo added investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Feb 10, 2021
@feulf
Copy link

feulf commented Feb 20, 2021

I'm running into this problem right now with typescript 4.1.5

@ricmoo
Copy link
Member

ricmoo commented Feb 25, 2021

I have put up a tweet seeking community feedback. If I haven't heard any compelling reasons by next week, I will bump the version and re-publish.

Any feedback is welcome!

Thanks! :)

@ricmoo ricmoo added enhancement New feature or improvement. and removed investigate Under investigation and may be a bug. labels Feb 25, 2021
@feulf
Copy link

feulf commented Mar 3, 2021

Hi, are you thinking of a specific date for bumping to typescript 4.2.2?

@ricmoo
Copy link
Member

ricmoo commented Mar 4, 2021

Probably this weekend. I’ve given notice on Twitter and been using 4.2.2 for a week or so to make sure there are obvious no hiccups… I am currently using it in my local v6 branch and things seem fairly compatible. :)

ricmoo added a commit that referenced this issue Mar 7, 2021
@ricmoo
Copy link
Member

ricmoo commented Mar 8, 2021

Can you try out 5.0.32 and let me know how it works for you? It is using TypeScript 4.2.2.

@feulf
Copy link

feulf commented Mar 17, 2021

I bumped both "ethers": "^5.0.32" and "typescript": "^4.2.2".

When I run npx tsc -p tsconfig.json I still get this errors:

node_modules/@ethersproject/providers/src.ts/base-provider.ts:1387:32 - error TS2322: Type 'null' is not assignable to type 'Resolver'.
...
node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:279:13 - error TS2322: Type 'Networkish | undefined' is not assignable to type 'Networkish | Promise<Network>'.

Ideas?

@ricmoo
Copy link
Member

ricmoo commented Mar 17, 2021

Sounds like you have strict null checking enabled on libraries? V5 doesn’t support strict bull checking. There is an option on the tsconfig to disable checking libraries for strict...

@feulf
Copy link

feulf commented Mar 17, 2021

I updated these 2 parameters in my tsconfig.json and it works fine now:

    "strict": false,
    "noImplicitAny": false,

Thanks @ricmoo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

3 participants