-
Notifications
You must be signed in to change notification settings - Fork 244
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
"vue-tsc" fails with "error TS2769: No overload matches this call" in "strict" mode #1973
Comments
Hi @tinobino and thanks for the repro After looking at your repro, it does look like there is an issue, but I don't know if that should be fixed in Vue core, VTU or Volar. The error goes away if:
Let me ping @johnsoncodehk as he may have some idea of what's going on |
It seems due to Line 204 in f68ceee
- export declare function mount<T extends DefineComponent<any, any, any, any, any>>(component: T, options?: ComponentMountingOptions<T>): VueWrapper<InstanceType<T>>;
+ export declare function mount<T extends DefineComponent<any, any, any, any, any, any, any, any, any, any>>(component: T, options?: ComponentMountingOptions<T>): VueWrapper<InstanceType<T>>; |
@johnsoncodehk Thanks for taking a look! Sadly, it doesn't look like it's fixing the issue |
Hi guys! Any updates on this? This issue prevents us from upgrade to latest vue version. |
@johnsoncodehk kindly offered (on another channel) to refactor the types when he has time, so this issue will get fixed, but we can't give you a timeline. In the meantime, you can still upgrade to the latest vue version, by adding an explication cast |
I've added this to an // TODO: Remove once https://github.com/vuejs/test-utils/issues/1973 is resolved
declare module '@vue/test-utils' {
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
export function mount<T extends DefineComponent<{}, {}, any>>(
component: T,
options?: ComponentMountingOptions<T>
): VueWrapper<InstanceType<T>>;
} |
I will check it out next week. |
Thanks, just a heads up: this should be put in a module file (i.e. with at least one top level export or import - in doubt add |
Please track #2026 |
This commit also drops node 14 from the build The public signatures of `mount` and `renderToString` are now simplified, and should be more accurate. Fixes #1973
Thanks to @johnsoncodehk , the issue should be fixed in the next release (I added a test based on @tinobino repro to make sure we don't have this again). |
Describe the bug
vue-tsc
fails with "error TS2769: No overload matches this call" in when "strict" mode is configured in "tsconfig.json".If the
defineEmits
part in the component is removedvue-tsc
doesn't complain. Seems that this issue is somehow related with Vue version 3.2.46.To Reproduce
https://stackblitz.com/edit/vitest-dev-vitest-nwzj9x?file=components%2FSlotComponent.vue,test%2FSlotComponent.test.ts,package.json&initialPath=__vitest
Expected behavior
vue-tsc
does not fail for the example given.The text was updated successfully, but these errors were encountered: