Currently, I am facing Duplicate Identifier errors while trying to set up my angular 2 with webpack 2 and typescript 2. Despite researching various solutions, none have proven effective thus far.
The errors are as follows:
typings\globals\core-js\index.d.ts
`Duplicate identifier 'PropertyKey'
typings\globals\core-js\index.d.ts
`Duplicate identifier 'Promise'
typings\globals\es6-promise\index.d.ts
`Duplicate identifier 'Promise'
typings\globals\es6-shim\index.d.ts
`Duplicate identifier 'PropertyKey'
I attempted adding the ambient dependency to my typings.json file without success, and also experimented with removing the globalDependencies entirely, leaving only the ambientDependencies:
{
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160725163759",
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"es6-collections": "registry:dt/es6-collections#0.5.1+20160316155526",
"es6-promise": "registry:dt/es6-promise#0.0.0+20160614011821",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160909174046"
},
"ambientDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160215162030"
}
}
...
- Angular 2 version: 2.0.0-rc.6
- Typescript version: 2.0.2
- Webpack version: 2.1.0-beta.20
If you have any suggestions or insights on this issue, your assistance would be greatly appreciated.
Thank you!
Update: Following Dave V's solution, the following directories were removed from the typings directory:
globals/es6-promise
globals/es6-shim
browser
References in index.d.ts within the typings root were amended by removing:
/// <reference path="globals/es6-promise/index.d.ts" />
/// <reference path="globals/es6-shim/index.d.ts" />
Furthermore, I included "typings/browser.d.ts"
in the tsconfig.json exclude array as it referenced es6-shim
inside browser/ambient
:
"exclude":[
"node_modules",
"typings/main",
"typings/main.d.ts",
"typings/browser.d.ts"
]