TS2304 Cannot find name 'Map', 'Set', 'Promise'

xiaoxiao2021-02-28  61

此问题解决地址

解决地址:https://stackoverflow.com/questions/39416691/webpack-ts2304-cannot-find-name-map-set-promise

原因

由于Map和Set是es6的特性,之前我的tsconfig.json设置的"target" : "es5"导致不能引入新的特性,因此需要更换为"target" : "es6"再执行就Ok了

{ "compilerOptions": { "target": "es6", "sourceMap": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "module": "system", "moduleResolution": "node", // <----- "noImplicitAny": false // "outDir": "../../templates/build", // "rootDir": "../../templates/script" } // "exclude": [ // "node_modules", // "typings/main", // "typings/main.d.ts" // ] , "include": ["./script/**/*"] , "exclude": ["node_modules","js"] }
转载请注明原文地址: https://www.6miu.com/read-71434.html

最新回复(0)