![](/img/trans.png)
[英]SPFx Webpart - node_modules/@types/ [prop types] and [react] index.d.ts: loads of "error TS1005" on gulp build
[英]VS2017 Build failing because of react/types/index.d.ts
我已经在VS2017中设置了Typescript + React项目。 我正在使用webpack来编译tsx,这编译得很好。
但是现在当我构建项目时,由于node_modules\\@types\\react\\index.d.ts
出现一些随机的语法错误,该项目失败了(我已经安装了所有最新版本的Typescript,react)。
错误生成:“>”预期。
要解决这个问题,我有什么选择?如何正确构建它,或者只是忽略此错误并继续?
tsconfig.json看起来像这样:
{
"compilerOptions": {
"outDir": "./dist",
"sourceMap": true,
"noImplicitAny": false,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"moduleResolution": "node",
"skipLibCheck": true,
"skipDefaultLibCheck": true
},
"compileOnSave": false,
"include": [
"./PageModels/src/**/*"
],
"exclude": [
"node_modules",
"wwwroot"
]
}
为我更新了最新版本的Visual Studio,此版本使用的TypeScript与我通过npm安装的版本不同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.