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>;
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...
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?
This is one of the breaking changes in TS 3.7 - thanks for the heads-up @FSM1
Oh! I just looked at that file... Yes, I'm surprised that ever worked... I'll fix that now. :)
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. :)
Works a charm @ricmoo 馃挴
Most helpful comment
This has been published to NPM and a release has been cut.
Please try out
4.0.38and let me know if you still have any problems. :)