Base solution for your next web application
Open Closed

tsc.exe exited with code 1 #3828


User avatar
0
klawsuc created

Using build 4.4.0 (Core + Angular), Visual Studio 2017, Typescript 2.5 (installed VS extension). I get the following error when I try to build the *.Web.Host project.

npm - v5.4.1 node - v6.11.3 tsc - v0.8.3.1

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

9 Answer(s)
  • User Avatar
    0
    klawsuc created

    I also have a solution built on 4.1.1 and it works fine. The one thing I did for the 4.4.0 build is to add the nuget package System.ComponentModel.TypeConverter to all the projects as proposed at #3739@78245cf2-355c-4cd1-a9a8-be05b24814ae

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    klawsuc created

    I turned on detailed logging and here is where the issue occurs:

    C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.exe --project "C:\inetpub\myproject_4.4.0\src\MyProject.Web.Host\e2e\tsconfig.json" --listEmittedFiles --locale en-US
    Unknown output: Unknown extension for file: "C:\inetpub\myproject_4.4.0\src\MyProject.Web.Host\e2e\tsconfig.json". Only .ts and .d.ts extensions are allowed.
    Unknown output: Unknown extension for file: "en-US". Only .ts and .d.ts extensions are allowed.
    Unknown output: Unknown option 'project'
    Unknown output: Use the '--help' flag to see options
    Unknown output: Unknown option 'listEmittedFiles'
    Unknown output: Use the '--help' flag to see options
    Unknown output: Unknown option 'locale'
    Unknown output: Use the '--help' flag to see options
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5\build\Microsoft.TypeScript.targets(247,5): error MSB6006: "tsc.exe" exited with code 1.
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    klawsuc created

    Digging a bit further, looks like Target CompileTypeScriptWithTSConfig: Task "VsTsc" are running C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.exe which is an old VS 2012 file. How do I force it to use C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5\tsc.exe?

    I already have the following in the csproj file:

    <TypeScriptToolsVersion>2.5</TypeScriptToolsVersion>
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    klawsuc created

    Seems like I'm just talking to myself here but in case someone comes across this and has an answer. I added the following to csproj but I not sure what the side effects might be:

    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
    

    Here is the log related to the tsc where I had an issue previously

    Target PreComputeCompileTypeScriptWithTSConfig:
    Using "VsTsc" task from assembly "C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5\build\TypeScript.Tasks.dll".
    Task "VsTsc"
        Unknown output: TypeScript compile is skipped because the TypeScriptCompileBlocked property is set to 'true'.
    Done executing task "VsTsc".
    Task "VsTsc"
        Unknown output: TypeScript compile is skipped because the TypeScriptCompileBlocked property is set to 'true'.
    Done executing task "VsTsc".
    Target CompileTypeScriptWithTSConfig:
      Task "VsTsc"
        Unknown output: TypeScript compile is skipped because the TypeScriptCompileBlocked property is set to 'true'.
    Done executing task "VsTsc".
      Task "VsTsc"
        Unknown output: TypeScript compile is skipped because the TypeScriptCompileBlocked property is set to 'true'.
     Done executing task "VsTsc".
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @klawsuc,

    You actually don't need compiling typescript files. Angular-cli builds & publishes angular application. Do you use merged solution or seperate We.Host & angular solutions ?

    Thanks.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    klawsuc created

    Still having an issue trying to get the site published properly. One thing I noticed is that tsc.exe is being called at C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.exe. That version is for VS 2012 (which I still have installed for legacy apps). However I have TS 2.1, 2.3, and 2.5 installed in their respective directories. In the project file I specify the target TS to be 2.5 (<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>). So the error happens at

    C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5\build\Microsoft.TypeScript.targets(247,5): error MSB6006: "tsc.exe" exited with code 1.
    

    But the initial tsc file that's called is

    C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.exe --project "C:\inetpub\SquireLab_angular_4.1.1\aspnet-core\src\SquireLab.Web.Host\e2e\tsconfig.json" --listEmittedFiles --locale en-US
    

    Is it normal for two different tsc programs to be called? Is there a way to only use 2.5?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    klawsuc created

    Also I want to clarify that I merged core and angular properly for the 4.1.1 version. I followed the instructions at <a class="postlink" href="https://www.aspnetzero.com/Documents/Merge-Angular-Client-Server">https://www.aspnetzero.com/Documents/Me ... ent-Server</a> I notice it states Angular 2 so I'm not sure if using core + angular 4 is different.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    klawsuc created

    Maybe someone can benefit from my two wasted days. Adding the following to the *.Web.Host.csporj file allowed me to build the application. In my case I wanted to use Typescript 2.5. I'm not sure why setting the TypeScriptToolsVersion property doesn't work properly...i.e. some of the calls are still made to "C:\Program Files (x86)\Microsoft SDKs\TypeScript\tsc.exe"

    <PropertyGroup>
        <TscToolPath>C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.5</TscToolPath>
      </PropertyGroup>
    

    Also the instructions at <a class="postlink" href="https://www.aspnetzero.com/Documents/Merge-Angular-Client-Server">https://www.aspnetzero.com/Documents/Me ... ent-Server</a> failed to mention that you need to make sure outDir in .angular-cli.json is set to wwwroot/dist. This is already the case in 4.4.0 when downloading an already merged app but was not in 4.1.1 having to manually merge the client with server app.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    alper created
    Support Team

    thanks for your feedback ;)

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)