akeneo / pim-community-dev

[Community Development Repository] The open source Product Information Management (PIM)
http://www.akeneo.com
Other
954 stars 514 forks source link

TS2322: Type 'JQuery<Element>' is not assignable to type 'JQuery<HTMLElement>'. #11995

Closed TheLifeofO closed 4 years ago

TheLifeofO commented 4 years ago

When running yarn webpack i receive the following error

tsl] ERROR in /srv/pim/web/bundles/pimdatagrid/js/datafilter/filters-column.ts(285,5)
      TS2322: Type 'JQuery<Element>' is not assignable to type 'JQuery<HTMLElement>'.
  Type 'Element' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 109 more.

Looks like this property

public filterList: JQuery<HTMLElement>;

Needs to be typed to JQuery<Element>

Rashguir commented 4 years ago

i have the same issue when installing akeneo 3.2

robingchan commented 4 years ago

this is just a temporary fix

temporary fix is open this file: web/bundles/pimdatagrid/js/datafilter/filters-column.ts

change line ~25 from this: public filterList: JQuery<HTMLElement>;

to this: public filterList: JQuery<Element>;

then run: yarn run webpack

simoncarre commented 4 years ago

Same issue here with v3.2.46

Thijzer commented 4 years ago

same issue here with v3.2.51

ERROR in /srv/pim/web/bundles/pimdatagrid/js/datafilter/filters-column.ts
./web/bundles/pimdatagrid/js/datafilter/filters-column.ts
[tsl] ERROR in /srv/pim/web/bundles/pimdatagrid/js/datafilter/filters-column.ts(289,5)
      TS2322: Type 'JQuery<Element>' is not assignable to type 'JQuery<HTMLElement>'.
  Type 'Element' is missing the following properties from type 'HTMLElement': accessKey, accessKeyLabel, autocapitalize, dir, and 109 more.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
jmleroux commented 4 years ago

Hey @robingchan ,

We can fix it but as we are open source, a PR would be also very welcome :wink:

tseho commented 4 years ago

2 days ago: https://github.com/DefinitelyTyped/DefinitelyTyped/commit/a6043265237484b65dc219e7b4b900377c927328

tseho commented 4 years ago

JQuery.find signature just changed :/

edit: the related PR on @types : https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44051

jmleroux commented 4 years ago

Nice catch Quentin.

jmleroux commented 4 years ago

Bad move Jquery :facepalm:

jmleroux commented 4 years ago

Merged in 3.2, it will be available in next v3.2.52 tag.

tseho commented 4 years ago

Thank you all, for taking the time to report the issue.