-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular 2.0.0-rc.5, @angular/router 3.0.0-rc.1, TS2304: Cannot find name 'Set', 'Map', 'Promise', 'MapConstructor' and 'SetConstructor'. #10891
Comments
You need to install the typings
Then in your project folder
|
Thnx @brandonroberts ! |
@brandonroberts, I am sorry, typings were already installed. In the package.json, you can see that on the post install, I have mentioned to install typings. typings folder is getting created and it's in the same level as typings.json. |
@pkozlowski-opensource, could you please reopen the issue. It's sad to see an issue being closed without verification. |
@jaliyaudagedara if you need further assistance come into the support channel at https://gitter.im/angular/angular |
@brandonroberts, thanks. Joining in! |
I was getting similar issue while running gulp task which was compiling ts. Solution from 'Akash' worked for me here http://stackoverflow.com/questions/33696885/typescript-gulp-task-error |
@brandonroberts Many Thanks man |
I also faced the similar issue.... I resolved it by installing npm install -g typings --save Then in your project folder typings install Also make sure that your need the latest typescript compiler. I am using Typescript 2.1.4 |
using 'typings' cli did not resolve the issue for me when using angular 2.4.1. It seems angular2 has changed the way it deals with typings dependencies and instead of relying on typings definitions from the typings cli, it's done through npm and the npm install --save-dev @types/core-js Make sure your tsconfig.json file has the 'types' property defined. Here's what my tsconfig.json file looks like. You may have to modify the path to {
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"../../node_modules/@types/"
],
"types" : [
"core-js"
]
},
"compileOnSave": true,
"exclude": [
"node_modules/*",
"**/*-aot.ts"
]
} |
Hey, @bogusred, I am also running into this issue with 2.4.1. I configured "typeRoots" to match my setup, but I am getting error TS2688: Cannot find type definition file for 'core-js'. Any suggestions? Update: i was missing "lib": ["es2015", "dom"] from my compilerOptions. Now compilation is successful. I noticed that I didn't need "types" set and that the Angular Quickstart tutorial doesn't set that property either. |
+1 |
It's also helpful to use the angular cli to generate a blank project and then copy+paste configs from there into your existing project. That's what I ended up doing after my last message and things seem to run smoother. |
install
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a
Environment
Issue
The single LOC in below app.routing.ts giving me following compile error.
app.routing.ts
Project Files
package.json
tsconfig.json
typings.json
Was trying out different ways like targeting ES6, but couldn't get it to working. Appreciate any help on this.
The text was updated successfully, but these errors were encountered: