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

Data properties make TypeScript types incompatible #8611

Closed
seggewiss opened this issue Jun 20, 2023 · 2 comments
Closed

Data properties make TypeScript types incompatible #8611

seggewiss opened this issue Jun 20, 2023 · 2 comments

Comments

@seggewiss
Copy link

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

@jakob-kruse
Copy link

This seems to be a duplicate of #2981

@seggewiss
Copy link
Author

This seems to be a duplicate of #2981

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

@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 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