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

Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). #19052

Closed
AbinayaSubbiah opened this issue Aug 17, 2017 · 12 comments
Closed

Comments

@AbinayaSubbiah
Copy link

I tried using the @types/jquery [version 3.2]package and facing below issues from jquery file.

ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (69,18): Generic type 'JQuery<TElement, HTMLEleme nt>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (119,89): Generic type 'JQuery<TElement, HTMLElem ent>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (128,63): Generic type 'JQuery<TElement, HTMLElem ent>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (128,84): Generic type 'JQuery<TElement, HTMLElem ent>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (147,101): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (149,65): Generic type 'JQuery<TElement, HTMLElem ent>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (704,45): Generic type 'JQuery<TElement, HTMLElem ent>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (2955,11): All declarations of 'JQuery' must have identical type parameters. ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (2991,87): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3020,84): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3032,118): Generic type 'JQuery<TElement, HTMLEl ement>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3136,85): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3147,119): Generic type 'JQuery<TElement, HTMLEl ement>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3156,90): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3194,85): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3206,119): Generic type 'JQuery<TElement, HTMLEl ement>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3349,51): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3356,17): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3716,70): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3727,48): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3920,49): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3969,93): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3978,94): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (3993,66): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4241,54): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4254,67): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4582,57): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4598,86): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4609,120): Generic type 'JQuery<TElement, HTMLEl ement>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4618,91): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4647,54): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4817,42): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (4828,49): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (5336,75): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (5336,129): Generic type 'JQuery<TElement, HTMLEl ement>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (5349,78): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (5349,117): Generic type 'JQuery<TElement, HTMLEl ement>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (5362,80): Generic type 'JQuery<TElement, HTMLEle ment>' requires 2 type argument(s). ERROR in E:/Incident sample/185508/ejproject/node_modules/@types/jquery/index.d.ts (5362,134): Generic type 'JQuery<TElement, HTMLEl ement>' requires 2 type argument(s).

@leonard-thieu
Copy link
Contributor

Update TypeScript to the most recent version.

@lweberk
Copy link

lweberk commented Aug 17, 2017

Same here with typescript 2.4.2. Is that version not supposed to be the latest stable to date?

@leonard-thieu
Copy link
Contributor

Are you getting this message in Visual Studio or by running tsc directly?

@lweberk
Copy link

lweberk commented Aug 17, 2017

With the official sublime text typescript plugin. I checked directly with tsc and it does not throw any errors. Makes me wonder whether i'm digging at the wrong place.

@lweberk
Copy link

lweberk commented Aug 17, 2017

Found the issue. It was plugin-related. The plugin did not get the default system path to the typescript sdk, thus reverting to 1.* feature set and consequently not correctly running as it would have from the CLI.

Thank you for your guidance.

@leonard-thieu
Copy link
Contributor

Glad you figured it out. Thanks for reporting back on your solution.

@AbinayaSubbiah
Copy link
Author

AbinayaSubbiah commented Aug 18, 2017

@leonard-thieu installed jQuery in my angular cli sample and getting this error message in Visual Studio code. Also updated typescript@2.4.2

And how to resolve it ? @lweberk

Also getting same issue while using angular seed.

@leonard-thieu
Copy link
Contributor

@AbinayaSubbiah could you post a minimum repro?

@lweberk
Copy link

lweberk commented Aug 21, 2017

@AbinayaSubbiah My case was for sublime text 3 running in a Debian (stretch) OS setup. Possibly quite different from your setup. In any case, the st3 plugin has an option to specify the path to the typescript libraries; typescript_tsdk, which in my case had to explicitly point to /usr/lib/nodejs/typescript/lib, since I'm using the Debian packaged versions of typescript (not npm install). The interesting thing to note is that instead of outright failing, typescript reverts to its 1.x feature set when unable to figure out where its library is... for whatever reason. That caused the errors to pop up. Maybe there is something similar in the VisualStudio-Typescript integration setup?

@LukeTOBrien
Copy link

This is still an open issue.
I have found the only workarround is to downgrade your @types/jquery.

It seems to be an issue with @types/datatables.net. I think the current version of datatables.net typings (1.10.5) is still not compatible withe the latest version of jquery typings (3.2.10).
For now, you can force the version of @types/jquery to 2.0.46.
Source

However this also causes errors in other parts of my code.
Could someone take a look at resolving this please. ;-)

@leonard-thieu
Copy link
Contributor

This is still an open issue.
I have found the only workarround is to downgrade your @types/jquery.

It seems to be an issue with @types/datatables.net. I think the current version of datatables.net typings (1.10.5) is still not compatible withe the latest version of jquery typings (3.2.10).
For now, you can force the version of @types/jquery to 2.0.46.
Source

However this also causes errors in other parts of my code.
Could someone take a look at resolving this please. ;-)

I'm unable to reproduce the error (https://github.com/leonard-thieu/DefinitelyTyped-issue-19052).

Could you post a minimal repro?

@orta
Copy link
Collaborator

orta commented Jun 7, 2021

Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the @types modules in DefinitelyTyped.

To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the definitely-typed channel.

@orta orta closed this as completed Jun 7, 2021
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

5 participants