@types/react package and had problems.[email protected].After patch upgrade from 16.7.18 to 16.7.19, tsc command in my project is failing with the following error:
node_modules/@types/react-dom/node_modules/@types/react/index.d.ts(2667,14): error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
node_modules/@types/react/index.d.ts(2682,14): error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
error Command failed with exit code 1.
I am not sure whether the issue lies as I am not explicitly using LibraryManagedAttributes in my project, hence logging this ticket.
Thanks.
You're having this problem because you have duplicate packages in your node modules I think. Can you check that first?
do you mean @types/react multiple times in package.json? If that's so, then no. All the packages in my package.json are referenced only once.
Are you using yarn or npm?
yarn
https://github.com/mohsinulhaq/react-popper-tooltip
here's the repository if that helps...
You can see it in the failing branch https://github.com/mohsinulhaq/react-popper-tooltip/compare/master...mohsinulhaq:greenkeeper%2F%40types%2Freact-16.7.19
The yarn.lock file needs to be manually updated after updating the dependency to 16.7.19 so that it doesn't produce two sets of @types/react in your node_modules directory, which sometimes happens when you update a transitive dependency in both Yarn and NPM.
You can fix it by deleting both @react/types entries in your yarn.lock and re-running yarn install. Let me know if that doesn't fix it.
sure, I will try this when I get back. Will inform you about it. Thanks!
Duplicate file node_modules/@types/react-redux/node_modules/@types/react/index.d.ts
Duplicate file node_modules/@types/react-redux/node_modules/@types/react/index.d.ts
what is the solution?
@ferdaber I regenerated the yarn lockfile and now the build is passing...thanks!
That^ didn't work for me, but this did.
yarn remove @types/react
yarn add @types/react
@alex-cory - it works for me, thanks
Most helpful comment
That^ didn't work for me, but this did.