Failed to pile.
/moonholdings.io/node_modules/@types/react-dom/node_modules/@types/react/index.d.ts (2312,14): Duplicate identifier 'LibraryManagedAttributes'.
Not sure why I'm getting this.
I've downgraded my "@types/node"
from 10 to 8 and that didn't work.
Also tried "@types/node": "^9.6.7"
My Repo: .io
My package.json
{
"name": "moonholdings.io",
"version": "0.1.0",
"private": true,
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/ --source-map",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive --source-map",
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
},
"dependencies": {
"@types/react": "^16.4.14",
"@types/react-redux": "^6.0.9",
"node-sass-chokidar": "^1.3.3",
"react": "^16.5.0",
"react-dom": "^16.5.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts-ts": "2.17.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@types/jest": "^23.3.2",
"@types/node": "^8.10.29",
"@types/react-dom": "^16.0.7",
"typescript": "^3.0.3"
}
}
Here is my tsconfig
{
"pilerOptions": {
"traceResolution": false,
"strictNullChecks": true,
"noImplicitAny": true,
"module": "esnext",
"target": "es5",
"lib": [
"es2015",
"es2017",
"es6",
"es7",
"es5",
"dom"
],
"jsx": "react",
"experimentalDecorators": true,
"moduleResolution": "node",
"baseUrl": "./src",
"noUnusedLocals": true,
"noUnusedParameters": false,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"importHelpers": true,
"strictFunctionTypes": false
},
"include": [
"src/**/*",
"webpack/**/*"
],
"files": [
"core.ts",
"sys.ts",
"types.ts",
"tsc.ts",
"registerServiceWorker.ts",
"src/registerServiceWorker.ts",
"src/setupTests.ts"
],
"exclude": [
"typings/browser.d.ts",
"typings/browser",
"typings",
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest"
]
}
Failed to pile.
/moonholdings.io/node_modules/@types/react-dom/node_modules/@types/react/index.d.ts (2312,14): Duplicate identifier 'LibraryManagedAttributes'.
Not sure why I'm getting this.
I've downgraded my "@types/node"
from 10 to 8 and that didn't work.
Also tried "@types/node": "^9.6.7"
My Repo: https://github./Futuratum/moonholdings.io
My package.json
{
"name": "moonholdings.io",
"version": "0.1.0",
"private": true,
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/ --source-map",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive --source-map",
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
},
"dependencies": {
"@types/react": "^16.4.14",
"@types/react-redux": "^6.0.9",
"node-sass-chokidar": "^1.3.3",
"react": "^16.5.0",
"react-dom": "^16.5.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts-ts": "2.17.0",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@types/jest": "^23.3.2",
"@types/node": "^8.10.29",
"@types/react-dom": "^16.0.7",
"typescript": "^3.0.3"
}
}
Here is my tsconfig
{
"pilerOptions": {
"traceResolution": false,
"strictNullChecks": true,
"noImplicitAny": true,
"module": "esnext",
"target": "es5",
"lib": [
"es2015",
"es2017",
"es6",
"es7",
"es5",
"dom"
],
"jsx": "react",
"experimentalDecorators": true,
"moduleResolution": "node",
"baseUrl": "./src",
"noUnusedLocals": true,
"noUnusedParameters": false,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"importHelpers": true,
"strictFunctionTypes": false
},
"include": [
"src/**/*",
"webpack/**/*"
],
"files": [
"core.ts",
"sys.ts",
"types.ts",
"tsc.ts",
"registerServiceWorker.ts",
"src/registerServiceWorker.ts",
"src/setupTests.ts"
],
"exclude": [
"typings/browser.d.ts",
"typings/browser",
"typings",
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest"
]
}
Share
Improve this question
edited Jun 20, 2020 at 9:12
CommunityBot
11 silver badge
asked Sep 13, 2018 at 23:30
Leon GabanLeon Gaban
39k122 gold badges348 silver badges550 bronze badges
8
-
So now you have
node_modules/@types/react-dom/node_modules/@types/react/index.d.ts
andnode_modules/@types/react/index.d.ts
? I think your project type dependencies must match your transitive types dependencies. – zerkms Commented Sep 13, 2018 at 23:39 - @Leon Gaban stackoverflow./questions/31322525/… – Arun AK Commented Sep 13, 2018 at 23:40
- @zerkms yes I have types for both – Leon Gaban Commented Sep 13, 2018 at 23:42
- @zerkms Ok so I removed the React types, and now getting other strange errors.... – Leon Gaban Commented Sep 13, 2018 at 23:46
- Also the answers in that question haven't helped so far :( but still digging in. – Leon Gaban Commented Sep 13, 2018 at 23:55
3 Answers
Reset to default 9You may find that the duplicates are located in node_modules/@types/react
and node_modules/types/react-dom/@types/react
or a similar set-up, in which one of the packages has a nested dependency on the other.
Uninstalling and reinstalling @types/react-dom and @types/react together is what fixed it for me.
yarn remove @types/react-dom @types/react
yarn add -D @types/react-dom @types/react
I'm still not sure what caused that bug, however I've checked out a much earlier version of my app, where it was stable. So going to continue work from there.
Here is the working package.json
{
"name": "moonholdings.io",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
},
"dependencies": {
"@types/jest": "^23.3.1",
"@types/node": "^10.9.4",
"@types/react": "^16.4.13",
"@types/react-dom": "^16.0.7",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"react-ts-with-scss": "2.1.0",
"typescript": "^3.0.3"
},
"devDependencies": {}
}
I had the same error.
I upgraded @types/react and @types/react-dom to their latest versions in package.json
and it fixed my error.