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

incompatible with latest Typescript compiler #622

Closed
FSM1 opened this issue Oct 7, 2019 · 6 comments
Closed

incompatible with latest Typescript compiler #622

FSM1 opened this issue Oct 7, 2019 · 6 comments
Labels
fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@FSM1
Copy link

FSM1 commented Oct 7, 2019

Having recently upgraded my project to Typescript 3.7.0-beta the project refuses to build throwing the following error:
node_modules/ethers/utils/bytes.d.ts:5:10 - error TS2440: Import declaration conflicts with local declaration of 'Arrayish'.

The error is thrown on the following line of code in utils/bytes.d.ts:

import { Arrayish } from './bytes';
export declare type Arrayish = string | ArrayLike<number>;
@ricmoo
Copy link
Member

ricmoo commented Oct 7, 2019

Does that mean that TS now has a type named Arrayish? Or are you using npm link for anything, which can also cause this kind of error...

@FSM1
Copy link
Author

FSM1 commented Oct 7, 2019

No, I think that it may be a change in how the compiler handles things.

I tried pulling the current ethers.js repo down and upgrading the TS version to 3.7.0-beta and receive the same error.

///////////////////////////////
// Imported Types

import { Arrayish } from './bytes';

///////////////////////////////
// Exported Types

export type Arrayish = string | ArrayLike<number>;

The import {} references itself, and then the type is re-declared in the export. Removing the import statement from utils/bytes.ts resolves the issue.

Tests are all passing.

@ricmoo can I author a merge request?

@FrozenKiwi
Copy link

This is one of the breaking changes in TS 3.7 - thanks for the heads-up @FSM1

@ricmoo
Copy link
Member

ricmoo commented Oct 16, 2019

Oh! I just looked at that file... Yes, I'm surprised that ever worked... I'll fix that now. :)

@ricmoo
Copy link
Member

ricmoo commented Oct 17, 2019

This has been published to NPM and a release has been cut.

Please try out 4.0.38 and let me know if you still have any problems. :)

@ricmoo ricmoo added the fixed/complete This Bug is fixed or Enhancement is complete and published. label Oct 17, 2019
@FSM1
Copy link
Author

FSM1 commented Oct 17, 2019

Works a charm @ricmoo 💯

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

No branches or pull requests

3 participants