Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on typescript class based component using construnctor and super #2243

Closed
lolmedo opened this issue Sep 26, 2020 · 1 comment
Closed

Comments

@lolmedo
Copy link

lolmedo commented Sep 26, 2020

Version

3.0.0

Reproduction link

https://codepen.io/lolmedo/pen/qBZvxpQ

Steps to reproduce

VueJS 3 project created with Vue CLI, edited with Visual Studio Code.

This code:
export default class Home extends Vue {
message: string;
constructor() {
super();
this.message = "";
}
}

Produces these runtime error messages in the browser:
[Vue warn]: Unhandled error during execution of setup function
at <Home onVnodeUnmounted=fn ref=Ref< undefined > >
at
at runtime-core.esm-bundler.js:38
[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next
at <Home onVnodeUnmounted=fn ref=Ref< undefined > >
at
at runtime-core.esm-bundler.js:38
Uncaught (in promise) TypeError: can't convert undefined to object
VueImpl vue-class-component.esm-bundler.js:257
_createSuperInternal Babel
Home Home.vue:14
setup vue-class-component.esm-bundler.js:340
callWithErrorHandling runtime-core.esm-bundler.js:154

What is expected?

Being able to use full typescript support with type definitions and variable initialization in the class constructor. This is supported in VueJS v2

What is actually happening?

Getting the following errors on browser:
[Vue warn]: Unhandled error during execution of setup function
at <Home onVnodeUnmounted=fn ref=Ref< undefined > >
at
at runtime-core.esm-bundler.js:38
[Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next
at <Home onVnodeUnmounted=fn ref=Ref< undefined > >
at
at runtime-core.esm-bundler.js:38
Uncaught (in promise) TypeError: can't convert undefined to object
VueImpl vue-class-component.esm-bundler.js:257
_createSuperInternal Babel
Home Home.vue:14
setup vue-class-component.esm-bundler.js:340
callWithErrorHandling runtime-core.esm-bundler.js:154

@posva
Copy link
Member

posva commented Sep 26, 2020

Please open the bug in vue-class-component repository

@posva posva closed this as completed Sep 26, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants