我正在VS2019中使用一个打字稿文件,并且遇到一个问题,我在运行项目构建时(而不是在保存时)仅在构建输出中看到一些错误。
我也看不到这些错误在文本编辑器中显示为扭曲。我也安装了Microsoft.TypeScript.MSBuild软件包。
尽管noEmitOnError
设置为true
,但打字稿错误也导致我的构建失败
这是我的tsconfig:
{
"compileOnSave": true,
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "ES2015",
"strict": true,
"allowJs": true
},
"include": [
"./wwwroot/js/pages/**/*"
],
"exclude": [
"node_modules"
],
"typeRoots": [
"./node_modules/@types"
]
}
这些是我的npm软件包
"devDependencies": {
"@types/jquery": "3.3.32",
"@types/lodash": "4.14.149",
"@types/moment": "2.13.0"
}
这是我的msbuild配置:
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="3.7.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
这是问题的屏幕截图:
关于如何解决此问题的任何想法?
更新
我能够通过重新启动PC来解决此问题