vite打包ts项目报错


node_modules/element-plus/lib/el-cascader-panel/src/node.d.ts:4:20 - error TS2304: Cannot find name 'Nullable'.

4     readonly data: Nullable<CascaderOption>;
                     ~~~~~~~~

node_modules/element-plus/lib/el-cascader-panel/src/node.d.ts:22:23 - error TS2304: Cannot find name 'Nullable'.

22     constructor(data: Nullable<CascaderOption>, config: CascaderConfig, parent?: Node, root?: boolean);
                         ~~~~~~~~

node_modules/element-plus/lib/el-cascader-panel/src/types.d.ts:50:20 - error TS2304: Cannot find name 'Nullable'.

50     expandingNode: Nullable<CascaderNode>;
                      ~~~~~~~~

node_modules/element-plus/lib/el-form/src/token.d.ts:28:11 - error TS2304: Cannot find name 'ComponentSize'.

28     size: ComponentSize;
             ~~~~~~~~~~~~~

node_modules/element-plus/lib/el-popper/src/use-popper/defaults.d.ts:7:34 - error TS2304: Cannot find name 'Nullable'.

7 export declare type RefElement = Nullable<HTMLElement>;
                                   ~~~~~~~~

node_modules/element-plus/lib/el-slider/src/slider.type.d.ts:23:17 - error TS2304: Cannot find name 'Nullable'.

23     firstValue: Nullable<number>;
                   ~~~~~~~~

node_modules/element-plus/lib/el-slider/src/slider.type.d.ts:24:18 - error TS2304: Cannot find name 'Nullable'.

24     secondValue: Nullable<number>;
                    ~~~~~~~~

node_modules/element-plus/lib/el-slider/src/slider.type.d.ts:25:15 - error TS2304: Cannot find name 'Nullable'.

25     oldValue: Nullable<number>;
                 ~~~~~~~~

node_modules/element-plus/lib/el-slider/src/slider.type.d.ts:69:48 - error TS2304: Cannot find name 'Nullable'.

69     [s in 'firstButton' | 'secondButton']: Ref<Nullable<ISliderButton>>;
                                                  ~~~~~~~~

node_modules/element-plus/lib/el-slider/src/slider.type.d.ts:89:18 - error TS2304: Cannot find name 'Nullable'.

89     tooltip: Ref<Nullable<HTMLElement>>;
                    ~~~~~~~~

node_modules/element-plus/lib/el-time-picker/src/common/props.d.ts:35:24 - error TS2304: Cannot find name 'ComponentSize'.

35         type: PropType<ComponentSize>;
                          ~~~~~~~~~~~~~

node_modules/element-plus/lib/el-tree/src/model/node.d.ts:28:24 - error TS2304: Cannot find name 'Nullable'.

28     get nextSibling(): Nullable<Node>;
                          ~~~~~~~~

node_modules/element-plus/lib/el-tree/src/model/node.d.ts:29:28 - error TS2304: Cannot find name 'Nullable'.

29     get previousSibling(): Nullable<Node>;
                              ~~~~~~~~

node_modules/element-plus/lib/utils/config.d.ts:2:11 - error TS2304: Cannot find name 'ComponentSize'.

2     size: ComponentSize;
            ~~~~~~~~~~~~~

项目配置

vue3.0+typescript+element-plus+vite2


 

找不到 name为 ComponentSize和Nullable