vue----vite创建v3+ts文件报错集合

146 阅读1分钟

vite.config.ts

1、找不到模块“vite”。你的意思是要将 "moduleResolution" 选项设置为 "node",还是要将别名添加到 "paths" 选项中?

解决办法 tsconfig.node.json 中修改 "moduleResolution": "Node",

tsconfig.node.json

1、Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.

解决办法 新版本TS已去掉该配置选项,删除该选项 allowImportingTsExtensions

2 "lib": [ "ES2023"], 找不到全局类型“Array”。

解决办法 修改为 其他的库

image.png