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
DerZade
changed the title
"Cannot find name 'T'", when using generics in SFC with named defineModel
"Cannot find name 'T'", when using generics in SFC and defineModel with name in backticks
Jan 10, 2025
DerZade
changed the title
"Cannot find name 'T'", when using generics in SFC and defineModel with name in backticks
"Cannot find name 'T'", when using generics and defineModel with name in backticks
Jan 10, 2025
Vue - Official extension or vue-tsc version
2.2.0
VSCode version
1.96.2
Vue version
3.5.13
TypeScript version
5.6.3
System Info
package.json dependencies
Steps to reproduce
npm create vue@latest
defineModel
which references that generic and has a name (in backticks).npm run type-check
What is expected?
The type check should return successfully.
What is actually happening?
vue-tsc
returns type errors:Link to minimal reproduction
https://github.com/DerZade/vue-tsc-define-model-generics-bug
Any additional comments?
The example repo includes four components, of which three work and one has errors:
defineProps<{ foo: T }>();
const model = defineModel<T>();
const model = defineModel<T>('model');
const model = defineModel<T>(`model`);
The text was updated successfully, but these errors were encountered: