My current setup includes typescript 1.7.5, typings 0.6.9, and angular 2.0.0-beta.0.
Is there a way to resolve the typescript compile error messages related to the Duplicate identifier
issue caused by typings definition files?
The error message points out duplicate identifiers in the definition files of various directories:
node_modules/angular2/typings/es6-shim/es6-shim.d.ts
node_modules/angular2/typings/jasmine/jasmine.d.ts
node_modules/angular2/typings/zone/zone.d.ts
typings/browser/ambient/es6-promise/es6-promise.d.ts
typings/browser/ambient/es6-shim/es6-shim.d.ts
typings/browser/ambient/jasmine/jasmine.d.ts
typings/browser/ambient/karma/karma.d.ts
typings/browser/ambient/zone.js/zone.js.d.ts
I'm curious about why the compiler is looking into node_modules/angular2
directory when it's excluded in tsconfig.json
.
I have raised this question on GitHub as well
Here is how my tsconfig.json looks like:
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
[...]
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
By changing the exclude
part of tsconfig.json
to remove specific exclusions, I managed to get rid of the errors:
"exclude": [
"node_modules",
"typings"
]
However, adding an additional reference path results in the reappearance of the same Duplicate identifier
compile errors:
/// <reference path="../../typings/browser.d.ts" />
For further reference, here is how my typings.json file is structured:
{
"name": "example-mean-app-client",
"dependencies": {},
"devDependencies": {},
"ambientDependencies": {
[...]
}
}