vue icon indicating copy to clipboard operation
vue copied to clipboard

Defining unknown properties as exist properties is wrong

Open nagaraja0yellapu opened this issue 1 year ago • 0 comments

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 https://github.com/vuejs/vetur/issues/2505
https://github.com/vuejs/composition-api/issues/609

Recently the same issue is created in Volar and closed mentioning common.ts definitions in vuejs/composition-api https://github.com/johnsoncodehk/volar/issues/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

nagaraja0yellapu avatar Jul 29 '22 12:07 nagaraja0yellapu

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

last-partizan avatar Aug 15 '22 11:08 last-partizan

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

colinblaise avatar Aug 17 '22 17:08 colinblaise

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

colinblaise avatar Aug 19 '22 13:08 colinblaise