Open Hongbusi opened 2 years ago
<script setup lang="ts"> interface Props { title: string } defineProps<Props>() // Error:模块的默认导出具有或正在使用专用名称 “Props”。 </script>
移除 composite:true 在 tsconfig.json 中,警告消失。详见:https://github.com/johnsoncodehk/volar/issues/1232
composite:true
使用 pnpm create vite 初始化项目之后,嫌两个配置文件看起来过于多余,于是手动合并了 tsconfig.json 和 tsconfig.node.json。
pnpm create vite
tsconfig.json
tsconfig.node.json
Vite 中关于修改 tsconfig.json 的讨论:
https://www.typescriptlang.org/docs/handbook/project-references.html
问题背景
解决方案
移除
composite:true
在 tsconfig.json 中,警告消失。详见:https://github.com/johnsoncodehk/volar/issues/1232问题原因
使用
pnpm create vite
初始化项目之后,嫌两个配置文件看起来过于多余,于是手动合并了tsconfig.json
和tsconfig.node.json
。Vite 中关于修改 tsconfig.json 的讨论:
相关文档
https://www.typescriptlang.org/docs/handbook/project-references.html