Skip to content

Nuget Packages - TSC 1.8 is not preferred to Typescript tooling (TSC 1.7.6) #6715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snerks opened this issue Jan 29, 2016 · 14 comments
Closed
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Visual Studio Integration with Visual Studio

Comments

@snerks
Copy link

snerks commented Jan 29, 2016

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.

Property 'render' is missing in type 'Element'.

@mhegazy
Copy link
Contributor

mhegazy commented Jan 29, 2016

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..

@mhegazy mhegazy added the Bug A bug in TypeScript label Jan 29, 2016
@mhegazy mhegazy added this to the TypeScript 1.8.2 milestone Jan 29, 2016
@snerks
Copy link
Author

snerks commented Jan 29, 2016

@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?

@paulvanbrenk
Copy link
Contributor

@snerks It should be 1.8 exactly

@snerks
Copy link
Author

snerks commented Jan 29, 2016

Thanks @paulvanbrenk. I tried this:

<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>

Same compiler error.

@paulvanbrenk
Copy link
Contributor

Can you share the detailed build diagnostics?

And you project file?

@snerks
Copy link
Author

snerks commented Jan 29, 2016

How do I collect detailed build diagnostics?

@snerks
Copy link
Author

snerks commented 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
Copy link
Author

snerks commented Jan 29, 2016

What is the preferred way to deliver detailed build diagnostics (2555 lines)?

@paulvanbrenk
Copy link
Contributor

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
Copy link
Author

snerks commented 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
Copy link
Contributor

mhegazy commented Jan 30, 2016

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.

@snerks
Copy link
Author

snerks commented Jan 30, 2016

@mhegazy @paulvanbrenk
OK. Thanks for the additional info.

@paulvanbrenk
Copy link
Contributor

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.

@paulvanbrenk paulvanbrenk added Visual Studio Integration with Visual Studio Fixed A PR has been merged for this issue labels Feb 1, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Visual Studio Integration with Visual Studio
Projects
None yet
Development

No branches or pull requests

3 participants