Currently, I am in the process of upgrading my project from angular2 beta15 to rc4. However, when I try to compile, I encounter the following error:
path/node_modules/@angular/common/src/directives/ng_class.d.ts(81,35): error TS2304: Cannot find name 'Set'.
This is how my tsconfig.json file looks:
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": false,
"declaration": true,
"outDir": "tmp/app"
},
"exclude": [
"node_modules",
"dist",
"tmp"
]
}
I have also added this to my main.ts file:
/// <reference path="../typings/index.d.ts" />
/// <reference path="../typings/tsd.d.ts"/>
and my typings.json file includes:
{
"name": "my-project",
"dependencies": {},
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160602141332",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"node": "registry:dt/node#6.0.0+20160621231320",
"moment": "registry:dt/moment#2.8.0+20160316155526",
"moment-node": "registry:dt/moment-node#2.11.1+20160329220348",
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654"
}
}
Switching "target": "ES5" to "ES6" in tsconfig.json resolves the error, but I must stick with ES5. It seems that including
///<reference path="../../node_modules/angular2/typings/browser.d.ts"/>
might be the missing piece here. Alternatively, as mentioned in https://github.com/typings/typings/issues/151, using typings/index.d.ts
should work as well.
I would greatly appreciate your insights on how to address this issue. Thank you in advance.