Home  >  Q&A  >  body text

TS2724: 'vue' has no exported member named 'JSXComponent'. Do you mean "component"?

<p>我正在尝试启动 Vue 3 Vuetify 项目,但在运行 <code>yarn build</code> 时遇到此错误:</p> <pre class="brush:php;toolbar:false;">>yarn build node_modules/vuetify/lib/components/index.d.mts:2:99 - error TS2724: '"vue"' 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: '"vue"' 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: '"vue"' 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;">{ "name": "frontend", "version": "0.0.0", "private": true, "scripts": { "dev": "vite", "build": "vue-tsc --noEmit && vite build", "preview": "vite preview", "lint": "eslint . --fix --ignore-path .gitignore" }, "dependencies": { "@mdi/font": "7.0.96", "core-js": "^3.29.0", "pinia": "^2.0.0", "roboto-fontface": "*", "vue": "^3.3.4", "vue-router": "^4.0.0", "vuetify": "^3.0.0", "webfontloader": "^1.0.0" }, "devDependencies": { "@babel/types": "^7.21.4", "@types/node": "^18.15.0", "@types/webfontloader": "^1.6.35", "@vitejs/plugin-vue": "^3.0.3", "@vue/eslint-config-typescript": "^11.0.0", "eslint": "^8.37.0", "eslint-plugin-vue": "^9.3.0", "sass": "^1.60.0", "typescript": "^5.0.0", "vite": "^4.3.8", "vite-plugin-vuetify": "^1.0.0", "vue-tsc": "^1.2.0" } }</pre></p>
P粉278379495P粉278379495384 days ago539

reply all(1)I'll reply

  • P粉924915787

    P粉9249157872023-09-03 09:35:19

    I solved this problem by updating the "build" script to remove the vue-tsc --noEmit command.

    reply
    0
  • Cancelreply