vue-cli: sample not working properly in vue3

Version

4.5.0

Reproduction link

https://github.com/kumaresan-subramani/vue3-suport

working sample

sample sample with "vue": "^2.6.11 works fine without any error

https://github.com/Saranya13/vue-sample/

Environment info

"vue": "^3.0.5"
"@vue/cli-plugin-babel": "^4.5.10",
    "@vue/cli-plugin-eslint": "^4.5.10",
    "@vue/cli-service": "^4.5.10",
    "@vue/compiler-sfc": "^3.0.5",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.8.0",
    "eslint-plugin-vue": "^7.4.1",

Steps to reproduce

clone above mentioned smple then npm i finally npm run serve

browser throws script error, but the same working fine in vue2

What is expected?

component gets rendered without script error

What is actually happening?

throws script error

component-base.js?5981:6 Uncaught TypeError: Object prototype may only be an Object or null: undefined
    at setPrototypeOf (<anonymous>)
    at extendStatics (component-base.js?5981:6)
    at __extends (component-base.js?5981:9)
    at eval (component-base.js?5981:20)
    at eval (component-base.js?5981:195)
    at Module../node_modules/@syncfusion/ej2-vue-base/src/component-base.js (chunk-vendors.js:575)
    at __webpack_require__ (app.js:849)
    at fn (app.js:151)
    at eval (index.js?4867:1)
    at Module../node_modules/@syncfusion/ej2-vue-base/src/index.js (chunk-vendors.js:599)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

I’m afraid not. Because it’s not a bug in Vue CLI.

The Vue 3 support of vue-class-component is done by @ktsn.

Is there any migration tool available?

The tool is not yet ready. Even if it’s ready, I’m afraid it won’t be helpful in this use case.

yes i tried but still facing same issue Vue module reference gets undefined.

Make sure you are using vue-class-component v8.0.0-rc.1, not v7.

I found a test case in its repo, it should work: https://github.com/vuejs/vue-class-component/blob/53c0535c81fea0a7f6d1d279318e671033b790d1/test/specs/test.spec.ts#L143-L167

@sodatea , yes i tried but still facing same issue Vue module reference gets undefined.

So i used definecomponent - it works but cant extend opions to root class

https://github.com/vuejs/vue-cli/issues/6217#issuecomment-762625391

Is there any migration tool available?