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

主vue3+ts,vite构建,只要安装了@types/react后,运行vue的ts检测就报错 #113

Open
yuhaijian opened this issue Mar 4, 2024 · 4 comments

Comments

@yuhaijian
Copy link

如题,我主项目是vue3,使用vite构建。存在@types/react后再用vue的ts检测就会报错了,这是为什么呀
image

@devilwjp
Copy link
Collaborator

devilwjp commented Mar 5, 2024

@yuhaijian
参考 https://github.com/devilwjp/veaury?tab=readme-ov-file#typescript-jsx-types-conflict-caused-by-vue-and-react-at-the-same-time

你的问题是vue和react的ts类型文件冲突了,需要根据不同的版本手动修改相关类型文件来解决,链接里只是提供了node_modules/@types/react/index.d.ts(@types/react@18.0.14)和node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts(@vue/runtime-dom@3.2.37)的解决方案,你还是要根据自身项目这两个文件的版本来自行兼容的

@devilwjp
Copy link
Collaborator

devilwjp commented Mar 5, 2024

@yuhaijian 或者你也可以提供一个你的范例项目,我fork一下然后看下你的问题

@yuhaijian
Copy link
Author

好的麻烦了,这个是我的示例项目https://github.com/yuhaijian/my-vue-app.git

@Ljy66
Copy link

Ljy66 commented Jun 7, 2024

请问一下这个问题后面解决了吗

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

No branches or pull requests

3 participants