npm run build打包的时候出现了ts-type的报错问题

问:

PS C:\Users\fury_123\Downloads\chatgpt-web-main (2)\chatgpt-web-main> npm run build

> chatgpt-web@2.10.3 build

> run-p type-check build-only

> chatgpt-web@2.10.3 type-check

> vue-tsc --noEmit

> chatgpt-web@2.10.3 build-only

> vite build

vite v4.5.3 building for production...

src/store/modules/chat/helper.ts:11:26 - error TS2322: Type '{ active: number; inputStatus: boolean; history: { uuid: number; title: string; isEdit: false; }[]; chat: { uuid: number; data: never[]; }[]; network: true; }' is not assignable to type 'ChatState'.

Object literal may only specify known properties, and 'inputStatus' does not exist in type 'ChatState'.

11 return { active: uuid, inputStatus: false, history: [{ uuid, title: '新的会话', isEdit: false }], chat: [{ uuid, data: [] }], network: true }

~~~~~~~~~~~~~~~~~~

src/store/modules/chat/index.ts:60:54 - error TS2339: Property 'chatData' does not exist on type '{ toggleNetwork(): void; addHistory(history: History, chatData?: Chat[]): void; updateHistory(uuid: number, edit: Partial<History>): void; ... 9 more ...; recordState(): void; } & { ...; } & _StoreWithState<...> & _StoreWithGetters<...> & PiniaCustomProperties<...>'.

60 console.log(this.history, 'this.history', this.chatData, 'this.chatData', history, chatData);

~~~~~~~~

src/store/modules/chat/index.ts:66:63 - error TS2345: Argument of type '{ uuid: number; data: Chat.Chat[]; inputStatus: boolean; }' is not assignable to parameter of type '{ uuid: number; data: { dateTime: string; text: string; inversion?: boolean | undefined; error?: boolean | undefined; loading?: boolean | undefined; conversationOptions?: { conversationId?: string | undefined; parentMessageId?: string | undefined; } | null | undefined; requestOptions: { ...; }; }[]; }'. Object literal may only specify known properties, and 'inputStatus' does not exist in type '{ uuid: number; data: { dateTime: string; text: string; inversion?: boolean | undefined; error?: boolean | undefined; loading?: boolean | undefined; conversationOptions?: { conversationId?: string | undefined; parentMessageId?: string | undefined; } | null | undefined; requestOptions: { ...; }; }[]; }'.

66 this.chat.unshift({ uuid: history.uuid, data: chatData, inputStatus: true });

~~~~~~~~~~~~~~~~~

src/store/modules/chat/index.ts:71:26 - error TS2339: Property 'inputStatus' does not exist on type '{ uuid: number; data: { dateTime: string; text: string; inversion?: boolean | undefined; error?: boolean | undefined; loading?: boolean | undefined; conversationOptions?: { conversationId?: string | undefined; parentMessageId?: string | undefined; } | null | undefined; requestOptions: { ...; }; }[]; }'.

71 if (this.chat[i].inputStatus) {

~~~~~~~~~~~

src/store/modules/chat/index.ts:72:24 - error TS2339: Property 'inputStatus' does not exist on type '{ uuid: number; data: { dateTime: string; text: string; inversion?: boolean | undefined; error?: boolean | undefined; loading?: boolean | undefined; conversationOptions?: { conversationId?: string | undefined; parentMessageId?: string | undefined; } | null | undefined; requestOptions: { ...; }; }[]; }'.

72 this.chat[i].inputStatus = false;

~~~~~~~~~~~

src/utils/request/index.ts:1:35 - error TS2724: '"axios"' has no exported member named 'AxiosReesponse'. Did you mean 'AxiosResponse'?

1 import type { AxiosProgressEvent, AxiosReesponse, GenericAbortSignal } from 'axios'

~~~~~~~~~~~~~~

src/utils/request/index.ts:25:32 - error TS2304: Cannot find name 'AxiosResponse'.

25 const successHandler = (res: AxiosResponse<Response<T>>) => {

~~~~~~~~~~~~~

src/views/chat/index.vue:335:41 - error TS2339: Property 'replace' does not exist on type 'Response<{ response: string; }>'.

335 const jsonDataString = jsonString.replace(/^data:/, '');

~~~~~~~

Found 8 errors in 4 files.

Errors Files

1 src/store/modules/chat/helper.ts:11

4 src/store/modules/chat/index.ts:60

2 src/utils/request/index.ts:1

1 src/views/chat/index.vue:335

ERROR: "type-check" exited with 2.

PS C:\Users\fury_123\Downloads\chatgpt-web-main (2)\chatgpt-web-main>

在打包的时候有报错,应该是类型检查导致的,我不希望打包的时候有类型检查

回答:

相关推荐
爱吃青椒不爱吃西红柿‍️几秒前
华为ASP与CSP是什么?
服务器·前端·数据库
一棵开花的树,枝芽无限靠近你4 分钟前
【PPTist】添加PPT模版
前端·学习·编辑器·html
陈王卜6 分钟前
django+boostrap实现发布博客权限控制
java·前端·django
景天科技苑14 分钟前
【vue3+vite】新一代vue脚手架工具vite,助力前端开发更快捷更高效
前端·javascript·vue.js·vite·vue项目·脚手架工具
SameX16 分钟前
HarmonyOS Next 安全生态构建与展望
前端·harmonyos
小行星12525 分钟前
前端预览pdf文件流
前端·javascript·vue.js
小行星12532 分钟前
前端把dom页面转为pdf文件下载和弹窗预览
前端·javascript·vue.js·pdf
Lysun00141 分钟前
[less] Operation on an invalid type
前端·vue·less·sass·scss
J总裁的小芒果1 小时前
Vue3 el-table 默认选中 传入的数组
前端·javascript·elementui·typescript
Lei_zhen961 小时前
记录一次electron-builder报错ENOENT: no such file or directory, rename xxxx的问题
前端·javascript·electron