You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nuget Packages - TSC 1.8 is not preferred to Typescript tooling (TSC 1.7.6) #6715
In a VS2015 Typescript HTML App, if I reference the Nuget packages for the 1.8 Typescript compiler and MSBuild Tasks, does the 1.8 TSC compiler in the Nuget package get used in preference to the version associated with the VS2015 Typescript tooling (1.7.6)?
I'm seeing that an attempt to reference a Stateless Functional Component (as shown in the SimpleGreeter example in the release notes) in (say) an App.tsx file, I still get the TSC 1.7 compiler "error":
Error TS2605 JSX element type 'Element' is not a constructor function for JSX elements.
Currently the TypeScriptToolsVersion needs to be 1.8 for it to work. I agree that the NuGet package version should take precedence. so we should fix this.
Meanwhile, please manually update your <TypeScriptToolsVersion> property to 1.8..
Mohamed Hegazy (@mhegazy) - Thanks for the feedback. However, having tried your suggestion to change the TypeScriptToolsVersion to 1.8.0, I see the same compiler error.
Is there an example project available that shows the Nuget TSC compiler + MSBuild combination working?
Warning 0 Your project file uses a newer version of the TypeScript compiler and tools than supported by this version of Visual Studio. Your project may be using TypeScript language features that will result in errors when compiling with this version of the TypeScript tools. To remove this warning, remove the element from your project file.
Should I expect to see squigglys in the IDE and the original compiler error in the Error List?
The version of your VS installation (1.7.6) is a different one from the one you are using to build in NuGet (1.8.0), so the error is expected. you can upgrade your VS installation, or use the older NuGet package to build.
Activity
mhegazy commentedon Jan 29, 2016
Currently the
TypeScriptToolsVersionneeds to be 1.8 for it to work. I agree that the NuGet package version should take precedence. so we should fix this.Meanwhile, please manually update your
<TypeScriptToolsVersion>property to1.8..snerks commentedon Jan 29, 2016
Mohamed Hegazy (@mhegazy) - Thanks for the feedback. However, having tried your suggestion to change the
TypeScriptToolsVersionto1.8.0, I see the same compiler error.Is there an example project available that shows the Nuget TSC compiler + MSBuild combination working?
paulvanbrenk commentedon Jan 29, 2016
snerks It should be
1.8exactlysnerks commentedon Jan 29, 2016
Thanks Paul van Brenk (@paulvanbrenk). I tried this:
Same compiler error.
paulvanbrenk commentedon Jan 29, 2016
Can you share the detailed build diagnostics?
And you project file?
snerks commentedon Jan 29, 2016
How do I collect detailed build diagnostics?
snerks commentedon Jan 29, 2016
For info, I'm seeing this after a build attempt:
Warning 0 Your project file uses a newer version of the TypeScript compiler and tools than supported by this version of Visual Studio. Your project may be using TypeScript language features that will result in errors when compiling with this version of the TypeScript tools. To remove this warning, remove the element from your project file.
snerks commentedon Jan 29, 2016
What is the preferred way to deliver detailed build diagnostics (2555 lines)?
snerks commentedon Jan 29, 2016
https://github.com/snerks/Ts18Vs2015Issue
Detailed Build Output:
https://github.com/snerks/Ts18Vs2015Issue/blob/master/DetailedBuildOutput.txt
paulvanbrenk commentedon Jan 29, 2016
You're importing the typescript targets and props file twice, remove the once, which don't point to the NuGet package folder.
See here https://github.com/Microsoft/TypeScript/wiki/Configuring-MSBuild-projects-to-use-NuGet
snerks commentedon Jan 30, 2016
I removed MSBuild references not pointing to the Nuget package folder. The detailed Build output now reports success:
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.10
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Should I expect to see squigglys in the IDE and the original compiler error in the Error List?
Screenshot:
https://github.com/snerks/Ts18Vs2015Issue/blob/master/Ts182HtmlApp.Issue.png
mhegazy commentedon Jan 30, 2016
The version of your VS installation (1.7.6) is a different one from the one you are using to build in NuGet (1.8.0), so the error is expected. you can upgrade your VS installation, or use the older NuGet package to build.
snerks commentedon Jan 30, 2016
Mohamed Hegazy (@mhegazy) Paul van Brenk (@paulvanbrenk)
OK. Thanks for the additional info.
paulvanbrenk commentedon Feb 1, 2016
Added logic to help determine when the version of the Nuget package doesn't match the version of the language service in VS, and show a warning in VS.