Pim-community-dev: TS2322: Type 'JQuery<Element>' is not assignable to type 'JQuery<HTMLElement>'.

Created on 28 Apr 2020  ·  11Comments  ·  Source: akeneo/pim-community-dev

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>

bug

Most helpful comment

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

All 11 comments

i have the same issue when installing akeneo 3.2

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

Same issue here with v3.2.46

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.

Hey @robingchan ,

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

JQuery.find signature just changed :/

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

Nice catch Quentin.

Bad move Jquery :facepalm:

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

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

Was this page helpful?
0 / 5 - 0 ratings