vue
vue copied to clipboard
Defining unknown properties as exist properties is wrong
Version
2.7.8
Reproduction link
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
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
Experiencing same issue. Major regression which is causing bugs to make it into production for us :(
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