Defining unknown properties as exist properties is wrong

This issue has been tracked since 2022-07-29.

Version

2.7.8

Reproduction link

github.com

Steps to reproduce

This issue was created first in Vetur & later fixed in @vuejs/composition-api as below
vuejs/vetur#2505

vuejs/composition-api#609

Recently the same issue is created in Volar and closed mentioning common.ts definitions in vuejs/composition-api
johnsoncodehk/volar#1350

What is expected?

Error has to be displayed when unknown property or data in template (typescript code)

What is actually happening?

No error is displayed when unknown property or data in template (typescript code) due to
export type Data = { [key: string]: unknown }
in types/common.d.ts

last-partizan wrote this answer on 2022-08-15

Looks like i stumbled upon this exact same bug, and prepared different reproduction

https://github.com/last-partizan/volar-starter/tree/f512fc22f07155c69f8602f0d37a6745e338b949

I have three files:

  • src/HasErrorOk.vue - error detected with vue2 and vue3
  • src/ShoudBeErrorWithDataAndMethods.vue - error not detected with vue2, but detected with vue3
  • src/ShoudBeErrorWithEmptyDefineComponent.vue - error not detected with vue2 and vue3
colinblaise wrote this answer on 2022-08-17

Experiencing same issue. Major regression which is causing bugs to make it into production for us :(

colinblaise wrote this answer on 2022-08-19

Can confirm that this is fixed in vue 2.7.9, thanks @yyx990803

Volar is still not showing any errors, but I assume we'll have to wait for a new version of Volar as well.

edit: Volar works for me now, I was just experiencing some weird caching issues after updating to vue 2.7.9

More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-10-05
Star Count 199792
Watcher Count 6093
Fork Count 32878
Issue Count 591

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date