TS2724:“vue”没有名为“JSXComponent”的导出成员。您指的是“组件”吗?
P粉278379495
P粉278379495 2023-09-02 11:22:21
[Vue.js讨论组]
<p>我正在尝试启动 Vue 3 + Vuetify 项目,但在运行 <code>yarn build</code> 时遇到此错误:</p> <pre class="brush:php;toolbar:false;">&gt;yarn build node_modules/vuetify/lib/components/index.d.mts:2:99 - error TS2724: '&quot;vue&quot;' has no exported member named 'JSXComponent'. Did you mean 'Component'? 2 import { Ref, DeepReadonly, ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, PropType, JSXComponent, ComponentInternalInstance, ComputedRef, Component, EffectScope, nextTick, WritableComputedRef, CSSProperties, Prop, Co mponentPublicInstance, InjectionKey, UnwrapRef } from 'vue'; ~~~~~~~~~~~~ node_modules/vuetify/lib/index.d.mts:2:29 - error TS2724: '&quot;vue&quot;' has no exported member named 'JSXComponent'. Did you mean 'Component'? 2 import { Ref, DeepReadonly, JSXComponent, PropType, CSSProperties, App } from 'vue'; ~~~~~~~~~~~~ node_modules/vuetify/lib/labs/components.d.mts:2:69 - error TS2724: '&quot;vue&quot;' has no exported member named 'JSXComponent'. Did you mean 'Component'? 2 import { ComponentPropsOptions, ExtractPropTypes, Ref, EffectScope, JSXComponent, PropType, UnwrapRef, CSSProperties, nextTick, VNode } from 'vue'; ~~~~~~~~~~~~ Found 3 errors in 3 files. Errors Files 1 node_modules/vuetify/lib/components/index.d.mts:2 1 node_modules/vuetify/lib/index.d.mts:2 1 node_modules/vuetify/lib/labs/components.d.mts:2</pre> <p>这是我的<code>package.json</code>:</p> <pre class="brush:php;toolbar:false;">{ &quot;name&quot;: &quot;frontend&quot;, &quot;version&quot;: &quot;0.0.0&quot;, &quot;private&quot;: true, &quot;scripts&quot;: { &quot;dev&quot;: &quot;vite&quot;, &quot;build&quot;: &quot;vue-tsc --noEmit &amp;&amp; vite build&quot;, &quot;preview&quot;: &quot;vite preview&quot;, &quot;lint&quot;: &quot;eslint . --fix --ignore-path .gitignore&quot; }, &quot;dependencies&quot;: { &quot;@mdi/font&quot;: &quot;7.0.96&quot;, &quot;core-js&quot;: &quot;^3.29.0&quot;, &quot;pinia&quot;: &quot;^2.0.0&quot;, &quot;roboto-fontface&quot;: &quot;*&quot;, &quot;vue&quot;: &quot;^3.3.4&quot;, &quot;vue-router&quot;: &quot;^4.0.0&quot;, &quot;vuetify&quot;: &quot;^3.0.0&quot;, &quot;webfontloader&quot;: &quot;^1.0.0&quot; }, &quot;devDependencies&quot;: { &quot;@babel/types&quot;: &quot;^7.21.4&quot;, &quot;@types/node&quot;: &quot;^18.15.0&quot;, &quot;@types/webfontloader&quot;: &quot;^1.6.35&quot;, &quot;@vitejs/plugin-vue&quot;: &quot;^3.0.3&quot;, &quot;@vue/eslint-config-typescript&quot;: &quot;^11.0.0&quot;, &quot;eslint&quot;: &quot;^8.37.0&quot;, &quot;eslint-plugin-vue&quot;: &quot;^9.3.0&quot;, &quot;sass&quot;: &quot;^1.60.0&quot;, &quot;typescript&quot;: &quot;^5.0.0&quot;, &quot;vite&quot;: &quot;^4.3.8&quot;, &quot;vite-plugin-vuetify&quot;: &quot;^1.0.0&quot;, &quot;vue-tsc&quot;: &quot;^1.2.0&quot; } }</pre></p>
P粉278379495
P粉278379495

全部回复(1)
P粉924915787

我通过更新“build”脚本以删除 vue-tsc --noEmit 命令解决了这个问题。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号