Pim-community-dev: TS2322:输入'JQuery<element>'不可分配给'JQuery类型<htmlelement>'。</htmlelement></element>

创建于 2020-04-28  ·  11评论  ·  资料来源: akeneo/pim-community-dev

运行yarn webpack出现以下错误

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.

看起来像这个属性

public filterList: JQuery<HTMLElement>;

需要输入到JQuery<Element>

最有用的评论

谢谢大家花时间报告此问题。

所有11条评论

安装akeneo 3.2时我遇到相同的问题

这只是一个临时解决方法

临时修复程序是打开此文件的:
网络/捆绑/pimdatagrid/js/datafilter/filters-column.ts

更改〜25行:
public filterList: JQuery<HTMLElement>;

对此:
public filterList: JQuery<Element>;

然后运行:
yarn run webpack

v3.2.46的同一问题

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

@robingchan

我们可以修复它,但由于我们是开源的,所以也非常欢迎PR:wink:

2天前: https :

jQuery.find签名刚刚更改:/

编辑: @types上的相关PR: https :

赶上昆汀。

不好的动作jQuery:facepalm:

与3.2合并,将在下一个v3.2.52标记中提供。

谢谢大家花时间报告此问题。

此页面是否有帮助?
0 / 5 - 0 等级