The TypeScript Compiler was given no files for compilation, so it will skip compiling

后端 未结 6 1391
无人及你
无人及你 2020-12-17 02:38

When i am trying to Build my default JavaScript project(BlankApp Apache Cordova) in Visual Studio 2015 preview am getting following error.

The TypeScr

相关标签:
6条回答
  • 2020-12-17 03:14

    This warning was driving me nuts with ASP.NET 5 (asp.net core 1). If you double click the warning you open the Microsoft.TypeScript.targets file. Delete the line with CompileTypeScript and the warning goes away. I'm assuming this prevents TypeScript from compiling normally, which is fine by me as I don't want it anyway.

    <PropertyGroup>
      <CompileDependsOn>
        CompileTypeScript;  <--- delete this line
        $(CompileDependsOn);
      </CompileDependsOn>
    
    0 讨论(0)
  • 2020-12-17 03:28

    I had the same issue.

    Mine was due to missing system variable to nodejs. Check your visual studio output. If it is not recognizing “node” command, add system variable.

    Computer->right click-> properties -> advanced system settings -> Environment Variable

    Check “path” under user variables and system variables

    Add the nodejs path to it. Ie: C:\Program Files (x86)\nodejs

    0 讨论(0)
  • 2020-12-17 03:29

    It seems that there is no type script file available to compile. add a blank type script file under script folder and then compile, it should work.

    0 讨论(0)
  • 2020-12-17 03:30
    • Option 1: Take Project offline, edit project, remove the following lines:

    <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')"/>

    and

    <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />

    • Option 2: Change "AddTypeScriptReferencePath": true to false in Webessentials-Settings.json
    0 讨论(0)
  • 2020-12-17 03:31

    This is a known issue in the CTP3 release. It sounds like you've created a JS-based project, and have not added any TypeScript files, and so of course there are no .ts (aka TypeScript) files passed to the compiler. Ideally the compiler wouldn't be run at all, but the warning is harmless, and everything else should otherwise be working.

    0 讨论(0)
  • 2020-12-17 03:32

    You need to make sure that at least one of your TypeScript files is marked with the TypeScriptCompile build action.

    If you click on the file and check the properties window in Visual Studio you will see the build action - it may be that they are all set to some other action.

    0 讨论(0)
提交回复
热议问题