-
Notifications
You must be signed in to change notification settings - Fork 245
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
Bug: Overload ts error when prop and slot exist together #2054
Comments
I tried this #741, but fails on my type-check |
I have exactly the same error using the script setup syntax after the upgrade from v. 2.0.0. |
A workaround is to wrap your component in another one like this example:
In this way I solved all ts errors. |
test-utils v2.4.0 should fix this issue (it fixes the repro from the OP) You can give it a try on your project as we released an |
any updates with the release of the version 2.4.0? |
@felixzapata we have an alpha out that you can try. If we have no regression reported, we should release a stable version soon. |
I know and I tried the alpha version. I just waiting for the release in order to update finally the package instead of using an alpha version. |
I just updated to Vue 3.3 and the latest Vitest and encountered this issue. My component seemed to work after removing the
|
Describe the bug
When writing a Jest test with test-utils and TypeScript, if both my simple boolean prop and a default slot are added, ts(2769) lights up claiming "No overload matches this call."
To Reproduce
Clone and install this repro repo. Open the /src/components/Foo/Foo.spec.ts file. The errors should display on all
mount()
calls underFoo
.⚠ Note: If either the default
slot
or thedark
prop definition insidedefineProps()
is removed, the error goes away. 🤔Expected behavior
I expect TypeScript to not error on that line.
Related information:
One of the errors being logged:
It's possible the error is stated in the text, but I have a hard time reading through all this mess. Also, some of the type defs appear truncated (e.g.
& string;...
). Any good way to get a clearer message? 😬Additional context
Git Bash CLI
Windows 10 - build 19041.1415
The text was updated successfully, but these errors were encountered: