arco-design / arco-design-vue

A Vue.js 3 UI Library based on Arco Design
https://arco.design/vue
MIT License
2.67k stars 521 forks source link

build 构建项目时错误,缺少索引签名 #1121

Closed lorron closed 2 years ago

lorron commented 2 years ago

使用arco初始创建,Arco Pro 项目,未做修改,build构建,缺少索引签名。 手动build,或使用github自动化构建,node14和node16环境均报错,详细如下: Run yarn install yarn install yarn build shell: /usr/bin/bash -e {0} yarn install v1.22.18 info No lockfile found. [1/5] Validating package.json... [2/5] Resolving packages... warning gifsicle > bin-build > tempfile > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. warning stylelint > @stylelint/postcss-markdown@0.36.2: Use the original unforked package instead: postcss-markdown warning stylelint-config-rational-order > stylelint > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated warning stylelint-config-rational-order > stylelint > postcss-markdown > remark > unified > @types/vfile > @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed. warning stylelint-config-rational-order > stylelint > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated warning stylelint-config-rational-order > stylelint > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated warning stylelint-config-rational-order > stylelint > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated warning vue-tsc > vscode-vue-languageservice@0.30.6: WARNING: This project has been renamed to @volar/vue-language-service. Install using @volar/vue-language-service instead. warning vue-tsc > vscode-vue-languageservice > @volar/html2pug@0.30.6: WARNING: This project has been renamed to @johnsoncodehk/html2pug. Install using @johnsoncodehk/html2pug instead. warning vue-tsc > vscode-vue-languageservice > vscode-pug-languageservice@0.30.6: WARNING: This project has been renamed to @volar/pug-language-service. Install using @volar/pug-language-service instead. warning vue-tsc > vscode-vue-languageservice > vscode-typescript-languageservice@0.30.6: WARNING: This project has been renamed to @volar/typescript-language-service. Install using @volar/typescript-language-service instead. [3/5] Fetching packages... [4/5] Linking dependencies... warning " > eslint-config-airbnb-base@14.2.1" has incorrect peer dependency "eslint@^5.16.0 || ^6.8.0 || ^7.2.0". [5/5] Building fresh packages... success Saved lockfile. $ husky install husky - Git hooks installed Done in 48.07s. yarn run v1.22.18 $ vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts Error: src/views/user/setting/components/user-panel.vue(5,10): error TS2322: Type '(options: RequestOption) => Promise' is not assignable to type '(option: RequestOption) => UploadRequest'. Type 'Promise' is not assignable to type 'UploadRequest'. Index signature for type 'string' is missing in type 'Promise'. Error: src/components/global-setting/form-wrapper.vue(6,6): error TS2322: Type 'string | number | boolean' is not assignable to type 'number | undefined'. Type 'string' is not assignable to type 'number'. Error: src/components/global-setting/form-wrapper.vue(11,6): error TS2322: Type 'string | number | boolean' is not assignable to type 'boolean | undefined'. Type 'string' is not assignable to type 'boolean | undefined'. Error: src/views/user/setting/components/enterprise-certification.vue(12,8): error TS2322: Type '({ label: string; value: number; } | { label: string; value: string; })[]' is not assignable to type 'DescData[]'. Type '{ label: string; value: number; } | { label: string; value: string; }' is not assignable to type 'DescData'. Type '{ label: string; value: number; }' is not assignable to type 'DescData'. Types of property 'value' are incompatible. Type 'number' is not assignable to type 'string | RenderFunction'. Error: src/views/dashboard/workplace/components/quick-operation.vue(12,37): error TS2322: Type '{ text: string; icon: string; }' is not assignable to type 'string | number | symbol | undefined'. Error: src/views/dashboard/monitor/components/data-statistic-list.vue(25,5): error TS2305: Module '"@arco-design/web-vue/es/table/interface.d"' has no exported member 'TableColumn'. Error: src/views/user/setting/components/user-panel.vue(22,10): error TS2322: Type '({ label: string; value: string | undefined; } | { label: string; value: number | undefined; })[]' is not assignable to type 'DescData[]'. Type '{ label: string; value: string | undefined; } | { label: string; value: number | undefined; }' is not assignable to type 'DescData'. Type '{ label: string; value: string | undefined; }' is not assignable to type 'DescData'. Types of property 'value' are incompatible. Type 'string | undefined' is not assignable to type 'string | RenderFunction'. Type 'undefined' is not assignable to type 'string | RenderFunction'. Error: src/views/dashboard/workplace/components/popular-content.vue(31,12): error TS2322: Type 'PopularRecord[] | undefined' is not assignable to type 'TableData[] | undefined'. Type 'PopularRecord[]' is not assignable to type 'TableData[]'. Type 'PopularRecord' is not assignable to type 'TableData'. Types of property 'key' are incompatible. Type 'number' is not assignable to type 'string'. Error: src/views/list/card/components/quality-inspection.vue(50,14): error TS2322: Type '{ value: unknown; label: string; }[] | undefined' is not assignable to type 'DescData[] | undefined'. Type '{ value: unknown; label: string; }[]' is not assignable to type 'DescData[]'. Type '{ value: unknown; label: string; }' is not assignable to type 'DescData'. Types of property 'value' are incompatible. Type 'unknown' is not assignable to type 'string | RenderFunction'. Error: src/views/list/search-table/index.vue(40,22): error TS2322: Type 'Options[]' is not assignable to type '(string | number | SelectOptionData | SelectOptionGroup)[]'. Type 'Options' is not assignable to type 'string | number | SelectOptionData | SelectOptionGroup'. Type 'Options' is missing the following properties from type 'SelectOptionGroup': isGroup, options Error: src/views/list/search-table/index.vue(52,22): error TS2322: Type 'Options[]' is not assignable to type '(string | number | SelectOptionData | SelectOptionGroup)[]'. Error: src/views/list/search-table/index.vue(75,22): error TS2322: Type 'Options[]' is not assignable to type '(string | number | SelectOptionData | SelectOptionGroup)[]'. error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error: Process completed with exit code 2.

flsion commented 2 years ago

ts 错误问题,可以参考下 https://arco.design/vue/docs/pro/faq#%E6%9E%84%E5%BB%BA%E7%9B%B8%E5%85%B3