Skip to content
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

angularjs.TypeScript.DefinitelyTyped includes an ancient version of jquery.d.ts #5446

Closed
mbraude opened this issue Aug 20, 2015 · 8 comments
Closed

Comments

@mbraude
Copy link

mbraude commented Aug 20, 2015

See this stack overflow post:

http://stackoverflow.com/questions/32088619/angularjs-definitely-typed-visual-studio-2015/32111765#32111765

If you add this package to a TypeScript project in Visual Studio and then reference it, you'll see hundreds of compiler errors. The reason why is because the d.ts file for jQuery appears to be ancient. For example, it uses "bool" instead of "boolean".

I was able to fix it by upgrading the jQuery package, or adding jQuery.TypeScript.DefinitelyTyped to the project, which replaced the old version with a new one that was correct.

@vvakame
Copy link
Member

vvakame commented Aug 21, 2015

@staxmanade ?

@staxmanade
Copy link
Member

This is the first I've heard about the issue.

In the .nuspec definition we place package dependencies like angularjs depends on jquery and it uses the following format to define it's dependencies

"<dependency id="$dependentPackageName" />"

Note there is no version specified and on this page https://docs.nuget.org/create/versioning#Specifying-Version-Ranges-in-.nuspec-Files it says empty = latest version. so it should be pulling the most recent jquery version...

What happens if you remove jquery.Typings.DefinitelyTyped and install from scratch?

Hmmm

@ivanoxq
Copy link

ivanoxq commented Aug 22, 2015

I just tested it and the issue is when you installed angularjs.typescript.definitelytyped 4.1.4, it apperantly says it needs jquery.Typings.DefinitelyTyped 0.1 version and install that instead of the latest version.

I uninstall the angularjs.typescript.definitelytyped, then it showed the latest jquery.Typings.DefinitelyTyped version and so I installed it. Afterwards I installed angularjs.typescript.definitelytyped

@xt0rted
Copy link
Contributor

xt0rted commented Aug 22, 2015

I've run into this a few times as well. It's due to the NuGet package manager UI in Visual Studio 2015 changing the dependency behavior from prior versions. It used to grab the most recent version (stable or prerelease depending on your settings) but now it lets you pick from

  • Ignore Dependencies
  • Lowest (default, at least on my machine)
  • Highest Patch
  • Highest Minor
  • Highest

Since versions aren't specified for the dependencies this is why the first jquery release is being used instead of the most recent.

@mbraude
Copy link
Author

mbraude commented Aug 22, 2015

You might want to comb through the other Nuget packages which have dependencies on other libraries and make similar changes to whatever you do here.

@nrice
Copy link

nrice commented Aug 26, 2015

I just ran into this issue on vs2015. jquery.Typings.DefinitelyTyped was version 001. I upgraded it to latest stable, errors disappeared.

@dawud-tan
Copy link

does this issue still occur?

@staxmanade
Copy link
Member

✅ ✅ ✅ Answer ✅ ✅ ✅

For anyone running into this issue: check the following setting in Visual Studio:

image

The default behavior may not have been “Lowest” before which may explain why this issue is new to Visual Studio 2015. To get things to work with the current angular TS definition package, you need to choose "highest" when you install or upgrade your package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants