question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TS2305: Module '"vue-demi"' has no exported member 'ComponentPublicInstance'.

See original GitHub issue
$ yarn build                
node_modules/@vueuse/core/index.d.ts:5:42 - error TS2305: Module '"vue-demi"' has no exported member 'ComponentPublicInstance'.

5 import { Ref, InjectionKey, ComputedRef, ComponentPublicInstance, UnwrapRef, ToRefs } from 'vue-demi';
                                           ~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
antfucommented, Sep 21, 2021

Please upgrade @vue/composition-api to v1.2.1 which added this type.

0reactions
dragomirwebcommented, Sep 21, 2021

It happens because vue-demi exports all typings from vue package. https://github.com/vueuse/vue-demi/blob/master/lib/index.d.ts#L15 Since it supports vue 2 and vue 3, which typings it exports depends on vue version you installed. As result @vueuse/core imports type ComponentPublicInstance from vue-demi, but this type exists only in vue 3 https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/componentPublicInstance.ts#L169 So if you have vue 2 installed, your build will be broken

I agree, it is a vue-demi issue and vue-demi is a dep. of vueuse

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue / Typescript, got Module '"*.vue"' has no exported member
I have to do this every time I created a import or export anything with TS. Share.
Read more >
Module '"vue"' has no exported member 'ref' - Get Help
Hey, I created NUXT project with typescript and when I am trying to use ref this error pops out. Module '“vue”' has no...
Read more >
no exported member named 'DefineComponent' -
ERROR in /path/to/node_modules/vue-echarts/dist/index.d.ts(1,90): 1:90 Module '"../../vue-demi/lib/index.js"' has no exported member ...
Read more >
Update Vue and related dependencies (major) - autoclosed
... runtime-dom: patchDOMProps should not set _value if element is custom element (#​4839) (1701bf3); types: export ref-macros.d.ts (1245709) ...
Read more >
解决TS2614 Module “.vue“ has no exported ... - CSDN博客
解决TS2614: Module “*.vue” has no exported member(Vue3+TypeScript)问题解决问题最近使用TS+Vue3.2写项目时碰到个问题:Vue组件中定义了一个接口 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found