Reputation: 45
When I build my new project in .Net Core VS2019 the build gets failed with an error. The project have some css and js files which uses typescript that cause this error. But I don't know what went wrong or what might be the cause of it.
I tried installing and unistalling the latest and old version of typescript and also installed the node.JS
The detailed output I get when I build is :
Task "VsTsc"
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe "C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js" --project "D:\Piccolo.Admin\Piccolo.Admin\wwwroot\assets\vendors\general\summernote\tsconfig.json" --listEmittedFiles --locale en-US
1> Unknown output: throw e;
1> Unknown output: ^
1> Unknown output: at Object.createNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:16472:20)
1> Unknown output: at createSynthesizedNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:60303:23)
1> Unknown output: at Object.createTypeQueryNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:60891:20)
1> Unknown output: at symbolToTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34983:31)
1> Unknown output: at createAnonymousTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34315:36)
1> Unknown output: at typeToTypeNodeHelper (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34251:28)
1> Unknown output: at C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34042:106
1> Unknown output: at withContext (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34083:37)
1> Unknown output: at Object.typeToTypeNode (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34042:28)
1> Unknown output: at typeToString (C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\tsc.js:34021:40)
1> C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.4\build\Microsoft.TypeScript.targets(462,5): error MSB6006: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe" exited with code 1.
1> Done executing task "VsTsc" -- FAILED.
Upvotes: 3
Views: 11207
Reputation: 455
I was having this issue when building a blazor server-side project that I debug and develop in vs2022 with docker.
This post led me to a solution that worked: https://developercommunity.visualstudio.com/t/compiletypescriptwithtsconfig-target-build-error/125778
I had to add the following property group:
<PropertyGroup>
<TypeScriptCompileBlocked>True</TypeScriptCompileBlocked>
</PropertyGroup>
Upvotes: 6
Reputation: 101
exclude node_modules folder from the project when you publish it
Upvotes: 0
Reputation: 117
In my case, I've Changed the ECMAScript to project requirements.
Best regards.
Upvotes: 0
Reputation: 96
I have the same error when I want to publish my project
C:\Program Files (x86)\Microsoft SDKs\TypeScript\3.7\build\Microsoft.TypeScript.targets(463,5): error MSB6006: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe" exited with code 1.
I set "MSBuild project build output verbosity" to "Detailed" in "Tools->Options->Projects and Solutions->Build and Run" and I see VS want to compile several .ts files and can't do that.
this is my .ts files can't compile
4>Target "CompileTypeScript" skipped, due to false condition; ('$(BuildingProject)' != 'false' AND '@(ConfigFiles)' == '' AND '@(TypeScriptCompile)' != '' AND '$(DesignTimeBuild)' != 'true') was evaluated as ('true' != 'false' AND 'App_Themes\Dashboard\Vendors\summernote\tsconfig.json' == '' AND 'App_Themes\Dashboard\Vendors\handlebars\lib\handlebars.d.ts;App_Themes\Dashboard\Vendors\moment\moment.d.ts;App_Themes\Dashboard\Vendors\perfect-scrollbar\types\perfect-scrollbar.d.ts;App_Themes\Dashboard\Vendors\popper.js\index.d.ts;App_Themes\Dashboard\Vendors\sweetalert2\sweetalert2.d.ts;App_Themes\Dashboard\Vendors\tooltip.js\index.d.ts;Scripts\index.d.ts' != '' AND '' != 'true').
I exclude these files and successfully published my project
you can exclude .ts file(s) from your project or modify and try again
Upvotes: 5