You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using vue-tsc on a Vue 2 component using the options API, the component methods are not included as part of the instance type if props is also present in the same component. For example:
@rchl Thanks for the guidance, I figured something like that would be the case for Vue2.
Interestingly, adding "strict": true doesn't help in my production repo - methods are still missing, but I'm having a harder time making a proper minimal reproduction.
Vue - Official extension or vue-tsc version
2.1.10
VSCode version
1.95.1
Vue version
2.7.16
TypeScript version
5.6.3
System Info
package.json dependencies
Steps to reproduce
Using
vue-tsc
on a Vue 2 component using the options API, the componentmethods
are not included as part of the instance type ifprops
is also present in the same component. For example:What is expected?
No error should be shown.
What is actually happening?
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-bxhnjs?file=src%2Fcomponents%2FHelloWorld.vue
Any additional comments?
Workaround: Following the comment in #1850 (comment), manually setting
vueCompilerOptions.optionsWrapper
seem to help:However, as a drawback, you then get a Doctor warning: https://github.com/vuejs/language-tools/blob/master/extensions/vscode/src/features/doctor.ts#L120
The text was updated successfully, but these errors were encountered: