Typescript: Property 'foo' does not exist on type 'Vue'.
See original GitHub issueVersion
2.5.17
Reproduction link
https://stackblitz.com/edit/typescript-bc9ywj
Steps to reproduce
- open
index.ts
, you will see:
- change
x: [String, Number, Array]
tox: [String, Number]
, then errors disappear:
What is expected?
no typing errors.
What is actually happening?
typing errors exist.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Resolve "Property does not exist on type 'Vue'" error
Resolve "Property does not exist on type 'Vue'" error · Ensure you include the ".vue" extension in the filename being imported · Add...
Read more >[Vue + Typescript] Property does not exist on type in computed ...
I still facing this issue and none of solution above can work for me! The warning Property 'xxx' does not exist on type...
Read more >Typescript: Property 'foo' does not exist on type 'Vue' - Sami C.
When I added a type on my setter val the error was no longer present! set(val: boolean) { (this as any).$emit('input', false); },....
Read more >♂️ ♀️ Vue 3 error with using TypeScript: property X does ...
♂️ ♀️ Vue 3 error with using TypeScript: property X does not exist on type 'EventTarget' · Simple Errors (3 Part Series) ·...
Read more >Vue/Typescript 3.5.1 Error: 'property' does not exist on type 'Vue'
Currently I downgraded Typescript back to 3.4.5. Is there any solution to solve the problem, maybe an updated definition file? Thanks for your ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Check https://vuejs.org/v2/guide/typescript.html
Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂
I get this typing error with the code above.
When I remove
then the compile error is gone.
Edit: I fixed the issue by
set(val
: boolean
)
, adding type to val.It’s my mistake not to add type to val but the lint should give the proper error. However it fixes automatically when you try to fix the other typing issues.
Hope it helps anyone who hits the similar issue.