vuejs / vue-class-component

ES / TypeScript decorator for class-style Vue components.
MIT License
5.81k stars 429 forks source link

"export 'default' (reexported as 'Component') was not found in 'vue-class-component' #516

Open abinhho opened 3 years ago

abinhho commented 3 years ago

I am using Vue3 and my package.json contains

"vue-class-component": "^8.0.0-0",
"vue-property-decorator": "^9.1.2",

Then i run start app on develop mode by yarn serve and got this warning.

INFO  Starting development server...
98% after emitting CopyPlugin
WARNING  Compiled with 2 warnings                                                                                                                                                                                                                 

warning  in ./node_modules/vue-property-decorator/lib/index.js

"export 'default' (reexported as 'Component') was not found in 'vue-class-component'

warning  in ./node_modules/vue-property-decorator/lib/index.js

"export 'default' (reexported as 'Vue') was not found in 'vue'
Giwayume commented 3 years ago

So far as I know, vue-property-decorator hasn't even started working on version 8 vue-class-component compatibility yet.

The Component decorator is renamed to Options.

vue-property-decorator 9.1.2 is still designed for vue-class-component version 7.2.6 and below. e.g. still designed for Vue 2.

Your only option for Vue 3 right now is to use only vue-class-component 8.0.0-rc.1 and scour the issues to figure out how it works. A couple of them are pinned.

Here's a discussion on vue-property-decorator Vue 3 support. https://github.com/kaorun343/vue-property-decorator/issues/294