New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New v3.3 syntax for defineEmits
does not work
#3169
Comments
Could you describe more in which way you are realising this issue? For me, type definitions when defining emits with the new syntax are not working properly. I falsely published that here but I think it has to do with the current version of volar LSP not being up to date with Vue 3.3. |
I just tried the new syntax, and it didn't work... just that. |
I'm seeing the same issue when I try to use the new error TS2344: Type 'Emits' does not satisfy the constraint '((...args: any[]) => any) | Record<string, any[]>'.
Type 'Emits' is not assignable to type 'Record<string, any[]>'.
Index signature for type 'string' is missing in type 'Emits'. when doing something like interface Emits {
someEmit: [value: string];
}
const emits = defineEmits<Emits>(); and this error: Argument of type 'string' is not assignable to parameter of type 'Emits'. when trying: emits('someEmit', value); |
It's working now, apparently after the last vue/core 3.3.2 release. |
I am on 3.3.2 and the issue is not fixed for me, I will open a new issue then. |
@Noxdor can confirm. still a problem for me on Vue 3.3.4 and vue-tsc 1.7.8 |
Vue 3.3 introduced a new syntax for
defineEmits
:Which is not supported by Volar yet.
The text was updated successfully, but these errors were encountered: