Cannot find name error when running with target es5
Hi All,
I am getting following error when running the project using npm run server:dev.
My tsconfig.json file: "target": "es5"
Error: Cannot find name 'Map'. Cannot find name 'Promise'. Cannot find name 'Set'.
If I change target to es6 then error goes away but my app stopped working in Internet explorer. Is there any way I can get rid of these error keeping es5 target?
I have also tried typings install but no luck.
Hey, I had this issue too using WebStorm. The problem is that the lib option doesn't seem to be supported (see this issue). What I did was remove the lib option and put core-js inside the types option. My tsconfig file looks like this:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noEmitHelpers": true,
"strictNullChecks": false,
"baseUrl": "./src",
"paths": {
"core": ["app/core"],
"shared": ["app/shared"]
},
"types": [
"lodash",
"core-js",
"hammerjs",
"jasmine",
"node",
"protractor",
"selenium-webdriver",
"source-map",
"uglify-js",
"webpack"
]
},
"exclude": [
"node_modules",
"dist"
],
"awesomeTypescriptLoaderOptions": {
"forkChecker": true,
"useWebpackText": true
},
"compileOnSave": false,
"buildOnSave": false,
"atom": { "rewriteTsconfig": false }
}
If this isn't the best work-around, please let me know.
@exk0730 - That was it.. It's working now with no errors.. Thanks a lot
better you upgrade the typescript version in WebStorm:
