Subscribe on changes!

Data properties make TypeScript types incompatible

avatar
Jun 20th 2023

Vue version

3.3.4

Link to minimal reproduction

https://github.com/seggewiss/vue-reproduction-1

Steps to reproduce

  1. Run npm install
  2. Open src/components/Problem.vue in your IDE of choice (Tested VsCode and PHPStorm myself)
  3. 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

avatar
Jun 21st 2023

This seems to be a duplicate of #2981

avatar
Jun 21st 2023

This seems to be a duplicate of #2981

Yes that seems to be the case. Thank you for pointing out 💙