typescript - Angular 2 cannot find file name 'Set' -
currently, updating project angular2 beta15 rc4. when compiling, getting error:
path/node_modules/@angular/common/src/directives/ng_class.d.ts(81,35): error ts2304: cannot find name 'set'.
my tsconfig.json looks following:
{ "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" ] }
in main.ts have included:
/// <reference path="../typings/index.d.ts" /> /// <reference path="../typings/tsd.d.ts"/>
and typings.json:
{ "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" } }
this error gone when change "target": "es5" "es6" in tsconfig.json, need use es5. assume issue comes when not include ///<reference path="../../node_modules/angular2/typings/browser.d.ts"/>
however, according https://github.com/typings/typings/issues/151, can use typings/index.d.ts
instead.
could please share opinion solve issue? thank in advance.
i think set
provided polyfill es6. angular2 recommends using core-js (see https://angular.io/guide/quickstart):
we begin core-js's es2015/es6 shim monkey patches global context (window) essential features of es2015 (es6)
you can specify within typings.json file need install typings using command typings install
.
Comments
Post a Comment