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.chati.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.chati.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>

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

回答:

相关推荐
敲代码的嘎仔3 小时前
从零实现视频续播 + 学习进度统计:前端心跳、条件更新、GROUP BY 统计全链路拆解
java·前端·数据库·学习·面试·职场和发展·音视频
不老刘3 小时前
一行命令解决 Node.js 版本兼容问题:`--openssl-legacy-provider` 深度解析
node.js
做萤石二次开发的哈哈3 小时前
海康移动交通四款设备技能接入实战:布控球+取证终端+测速仪+出入口终端,Web/App/小程序移动交通应用快速生成
前端·物联网·萤石开放平台·蓝海aiot一站式工作台·aiot开发·移动交通
IT_陈寒4 小时前
我TM竟然被Java的空指针坑了第三次!
前端·人工智能·后端
xcLeigh4 小时前
AI 编程学习路线图:一份覆盖前端、后端、全栈的系统学习计划
前端·人工智能·学习
linux_cfan4 小时前
HTML5 视频交互标注实践:用开源播放器 ZWPlayer 实现热区、测验与分支节点(附接入代码)
前端·javascript·音视频
小羊没烦恼!4 小时前
Office文件的奥秘——.NET平台下不借助Office实现Word、Powerpoint等文件的解析(完)
java·大数据·前端·网络·word·powerpoint·.net
风骏时光牛马4 小时前
AI提示词工程:高效构建精准指令的方法论
前端
葡萄城技术团队4 小时前
一个好的 BI Dashboard 到底应该怎么设计?
前端
晴天166 小时前
前端 postMessage 使用场景
前端·javascript·网络