ecomfe / vue-echarts

Vue.js component for Apache ECharts™.
https://vue-echarts.dev
MIT License
9.43k stars 1.48k forks source link

'"vue-demi"' has no exported member named 'DefineComponent' #750

Closed slavonicsniper closed 5 months ago

slavonicsniper commented 6 months ago

Confirmation

How are you introducing Vue-ECharts into your project?

ES Module imports

Versions

├─┬ vue-echarts@6.6.2
│ ├── echarts@5.4.3 deduped
│ ├─┬ vue-demi@0.13.11
│ │ └── vue@2.6.14 deduped
│ └── vue@2.6.14 deduped

Details

ERROR in .../node_modules/vue-echarts/dist/index.vue2.d.ts(1,10): 1:10 '"vue-demi"' has no exported member named 'DefineComponent'. Did you mean 'defineComponent'?

1 | import { DefineComponent, Ref } from 'vue-demi';

Reproduction

https://codesandbox.io/p/sandbox/suspicious-glitter-mk66j

Justineo commented 6 months ago

Please provide a reproduction with the latest version of vue-echarts.

slavonicsniper commented 6 months ago

image

Basically I reproduce this when using even the latest vue-echarts with vue@2.6.14.

slavonicsniper commented 6 months ago

related issue same issue

slavonicsniper commented 6 months ago

I setup a test vue project via vue-cli and I could not reproduce the issue using vue@2.6.14 and the vue-echarts@6.6.2 but it's not identical to the project where I have the issue, I cannot share that project though, will try to match all the other config, tsconfig, eslintrc.js, etc... whether I manage to reproduce it. If you have any insights what I should look for specifically, please let me know. It looks like people had this issue in past but all of them were closed without any specific solution.

Justineo commented 6 months ago

Maybe you can try run the postinstall script manually in your project.

https://github.com/ecomfe/vue-echarts/blob/8132842be76f33673498b379a07d12567081bf3e/package.json#L14

slavonicsniper commented 6 months ago

reproduced here

updating 'typescrit' npm seems to help

Justineo commented 6 months ago

Oh I see, the DefineComponent type is only exported from vue after v2.7. I'd suggest you to upgrade to vue@2.7.

Justineo commented 6 months ago

Hello, this issue should be resolved in v6.6.8. Could you please confirm?

kingyue737 commented 6 months ago

@Justineo https://www.npmjs.com/package/vue-echarts?activeTab=versions v6.6.8 has not been published on npm

Justineo commented 6 months ago

v6.6.8 has not been published on npm

I'm sorry, didn't check the publish result 😅

It's published now.