Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

jest types conflict #372

Open
ComicScrip opened this issue Jul 28, 2018 · 1 comment
Open

jest types conflict #372

ComicScrip opened this issue Jul 28, 2018 · 1 comment

Comments

@ComicScrip
Copy link

See this SO issue, now that CRAT is using ts-jest, there seems to be a conflict with @types/jest which can result in a Duplicate identifier 'beforeEach' error in some dev environnement configurations. To remove the compilation error, I had to get rid of @types/jest in package.json

I spent a few hours trynig to figure out this issue, so if this is somehow related to this project, maybe mentionned in the docs (or corrected if possible) ?

@DorianGrey
Copy link
Collaborator

CRA-TS is already using ts-jest for quite a while now, so an error of this kind would have raised earlier if it is a general one.

Duplicate identifier means that there is more than one type declaration for an identifer, in your case beforeEach. In most cases, this occurs if more than one version of a type definition is used in a project, e.g. because of transitive dependencies. If you hit an error like this, you should first check

yarn list <duplication-candidate>

resp.

npm ls <duplication-candidate>

to see if it yields more than one result (in most cases, it will).

Removing the lock file and let it be regenerated will likely help here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants