Data properties make TypeScript types incompatible
Vue version
3.3.4
Link to minimal reproduction
https://github.com/seggewiss/vue-reproduction-1
Steps to reproduce
- Run npm install
- Open
src/components/Problem.vue
in your IDE of choice (Tested VsCode and PHPStorm myself) - Line 19 will have a TypeScript error which it shouldn't
What is expected?
No TypeScript error in Line 19 of src/components/Problem.vue
.
What is actually happening?
A TypeScript error in Line 19 of src/components/Problem.vue
saying that the types are incompatible.
System Info
Mac OS Ventura 13.4
Node 19.9.0
NPM 9.6.3
Any additional comments?
This is a huge hassle for us since we have thousands of code lines where putting a data property in a function with type annotations now no longer match the type annotation. We could of course put a as Type
statement everwhere but that can't be the right solution, right?
Also the same issue arises with Vue 2.7.14