Element: PluginObject was not introduced in element-ui.d.ts file in [Bug Report] types file

Created on 13 Jun 2019  ·  7Comments  ·  Source: ElemeFE/element

Element UI version

2.9.1

OS/Browsers version

mac

Vue version

2.6.10

Reproduction Link

https://codepen.io/pen

Steps to reproduce

用ts的时候 报错element-ui下types 文件中element-ui.d.ts文件里PluginObject没有引入 打包不成功

What is Expected?

PluginObject在 element-ui.d.ts文件 头部引入

What is actually happening?

PluginObject在 element-ui.d.ts文件 头部未引入

Most helpful comment

same for me, my builds are failed now. For workaround I use in tsconfig.json "skipLibCheck": true but it should be fixed.

error  in /Users/user/dev/myproject/node_modules/element-ui/types/element-ui.d.ts

ERROR in /Users/user/dev/myproject/node_modules/element-ui/types/element-ui.d.ts
331:30 Cannot find name 'PluginObject'.
    329 | 
    330 | /** InfiniteScroll Directive */
  > 331 | export const InfiniteScroll: PluginObject<ElInfiniteScroll>;
        |                              ^
    332 | 
    333 | /** PageHeader Component */
    334 | export class PageHeader extends ElPageHeader {}

All 7 comments

Translation of this issue:

Element UI version

2.9.1

OS/Browsers version

Mac

Vue version

2.6.10

Reproduction Link

Https://codepen.io/pen

Steps to reproduce

It is unsuccessful to report that PluginObject was not introduced into the element-ui.d.ts file under element-ui when using ts.

What is Expected?

PluginObject is introduced into element-ui.d.ts file header

What is actually happening?

PluginObject was not introduced in element-ui.d.ts file header

same for me, my builds are failed now. For workaround I use in tsconfig.json "skipLibCheck": true but it should be fixed.

error  in /Users/user/dev/myproject/node_modules/element-ui/types/element-ui.d.ts

ERROR in /Users/user/dev/myproject/node_modules/element-ui/types/element-ui.d.ts
331:30 Cannot find name 'PluginObject'.
    329 | 
    330 | /** InfiniteScroll Directive */
  > 331 | export const InfiniteScroll: PluginObject<ElInfiniteScroll>;
        |                              ^
    332 | 
    333 | /** PageHeader Component */
    334 | export class PageHeader extends ElPageHeader {}

It's careless since this bug has been existing for more than half a month.

I worked-around by editing node_modules/element-ui/types/element-ui.d.ts and changing line 1 from

import Vue from 'vue'

to

import Vue, { PluginObject } from 'vue'

我也遇到了这个问题,没有引入 PluginObject,导致打包失败

Problem seems to have been already fixed in version 2.9.2.

问题已经在 2.9.2 版本中修复
Confirm this is fixed in 2.9.2, thanks!

Was this page helpful?
0 / 5 - 0 ratings