全栈开发操作问题等(持续更新中ing)

407 阅读1分钟

1、前端报错:Cannot find type definition file for 'vite/client'. The file is in the program because: Entry point of type library 'vite/client' specified in compilerOptions;

原因:TypeScript 无法找到 vite/client 的类型定义文件,这通常发生在 Vite + Vue 3 + TypeScript 项目中;

解决方法:

1、npm install --save-dev @vitejs/plugin-vue  安装类型定义
2、在项目根目录下创建 `vite-env.d.ts` 文件
declare module '*.vue' {
    import type { DefineComponent } from 'vue'; 
    const component: DefineComponent<{}, {}, any>; 
    export default component; 
}

项目中的位置

image.png

2、后端报错:

image.png 解决思路: 在这个目录下filecontroller排查,未配置默认上传文件的地址;

image.png

image.png