arco-design / arco-design-pro-vue

An out-of-the-box solution to quickly build enterprise-level applications based on Arco Design.
https://pro.arco.design
MIT License
1.34k stars 275 forks source link

arco-pro-vue 模板打包vue-tsc校验不通过 #98

Closed yanbowe closed 2 years ago

yanbowe commented 2 years ago

Basic Info

What is expected?

ts校验通过,正常打包

Steps to reproduce

使用arco-cli拉取vue-pro的精简代码,执行pnpm install pnpm build 打包失败

src/views/login/components/login-form.vue:11:8 - error TS2322: Type '({ errors, values, }: { errors: Record<string, ValidatedError> | undefined; values: LoginData; }) => Promise' is not assignable to type '(data: { values: Record<string, any>; errors: Record<string, ValidatedError> | undefined; }, ev: Event) => any'. Types of parameters '__0' and 'data' are incompatible. Type '{ values: Record<string, any>; errors: Record<string, ValidatedError> | undefined; }' is not assignable to type '{ errors: Record<string, ValidatedError> | undefined; values: LoginData; }'. Types of property 'values' are incompatible. Type 'Record<string, any>' is missing the following properties from type 'LoginData': username, password

11 @submit="handleSubmit"


src/views/dashboard/workplace/components/popular-content.vue:18:12 - error TS2322: Type '(contentType: string) => void' is not assignable to type '(value: string | number | boolean, ev: Event) => void'.
  Types of parameters 'contentType' and 'value' are incompatible.
    Type 'string | number | boolean' is not assignable to type 'string'.
      Type 'number' is not assignable to type 'string'.

18           @change="typeChange"

src/components/navbar/index.vue:45:38 - error TS2322: Type '(value: string) => void' is not assignable to type '(value: string | number | Record<string, any> | undefined, ev: Event) => any'. Types of parameters 'value' and 'value' are incompatible. Type 'string | number | Record<string, any> | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'.

45 <a-dropdown trigger="click" @select="changeLocale">


src/utils/env.ts:1:15 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`.

1 const debug = process.env.NODE_ENV !== 'production';

Found 4 errors in 4 files.

Errors Files 1 src/views/login/components/login-form.vue:11 1 src/views/dashboard/workplace/components/popular-content.vue:18 1 src/components/navbar/index.vue:45 1 src/utils/env.ts:1

yanbowe commented 2 years ago

完整版vue-tsc校验也是不通过,跟精简版是一个问题 image

yanbowe commented 2 years ago

提个小建议,git commit的时候可否在husky里加上vue-tsc --noEmit这个命令

yanbowe commented 2 years ago

image 我安装完依赖后dev之后报这个,然后页面一直无法加载出来

sHow8e commented 2 years ago

@yanbowe hihi 这些问题是因为组件库也会进行类型的调整,导致写法不匹配。你可以根据提示进行调整。或者对代码有自信的话可以去掉vue-tsc的ts校验。

sHow8e commented 2 years ago

image 我安装完依赖后dev之后报这个,然后页面一直无法加载出来

一样的原因。组件库变动导致了部分类型没导出。需要自行调整一下哈。后续版本我会更新到最新版的组件库再进行发布。3q

sHow8e commented 2 years ago

提个小建议,git commit的时候可否在husky里加上vue-tsc --noEmit这个命令

这个感觉有点耗时。可以考虑一下哈。

yanbowe commented 2 years ago

@yanbowe hihi 这些问题是因为组件库也会进行类型的调整,导致写法不匹配。你可以根据提示进行调整。或者对代码有自信的话可以去掉vue-tsc的ts校验。

还是不去掉吧哈哈

yanbowe commented 2 years ago

image 我安装完依赖后dev之后报这个,然后页面一直无法加载出来

一样的原因。组件库变动导致了部分类型没导出。需要自行调整一下哈。后续版本我会更新到最新版的组件库再进行发布。3q

收到

yanbowe commented 2 years ago

@yanbowe hihi 这些问题是因为组件库也会进行类型的调整,导致写法不匹配。你可以根据提示进行调整。或者对代码有自信的话可以去掉vue-tsc的ts校验。

这个项目里后续会更改吧?

yanbowe commented 2 years ago

提个小建议,git commit的时候可否在husky里加上vue-tsc --noEmit这个命令

这个感觉有点耗时。可以考虑一下哈。

加上最起码保证代码没问题👍

sHow8e commented 2 years ago

done v2.5.2

sqlFC commented 2 years ago

@sHow8e 打包校验不通过,这种怎么处理 image

sHow8e commented 2 years ago

@sHow8e 打包校验不通过,这种怎么处理 image

@sqlFC 这部分可以新开一个issue,提供复现方式。应该是插件问题。