Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【日常踩坑】模块的默认导出具有或正在使用专用名称 “Props” #31

Open
Hongbusi opened this issue Jun 6, 2022 · 0 comments
Labels

Comments

@Hongbusi
Copy link
Member

Hongbusi commented Jun 6, 2022

问题背景

<script setup lang="ts">
interface Props {
  title: string
}

defineProps<Props>() // Error:模块的默认导出具有或正在使用专用名称 “Props”。
</script>

解决方案

移除 composite:true 在 tsconfig.json 中,警告消失。详见:vuejs/language-tools#1232

问题原因

使用 pnpm create vite 初始化项目之后,嫌两个配置文件看起来过于多余,于是手动合并了 tsconfig.jsontsconfig.node.json

Vite 中关于修改 tsconfig.json 的讨论:

相关文档

https://www.typescriptlang.org/docs/handbook/project-references.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant