Skip to content
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: [TypeScript] findAllComponents type definition with Vue generic #2254

Open
joris-fonck-loreal opened this issue Nov 23, 2023 · 4 comments
Labels
bug Something isn't working has-pr

Comments

@joris-fonck-loreal
Copy link

joris-fonck-loreal commented Nov 23, 2023

Describe the bug

When I use a library that ship d.ts files for Vue.js components, using vite-plugin-dts, and I'm trying to do unit tests with findAllComponents function on a generic component, I have a TS error:

No overload matches this call.

If I put a @ts-ignore, the test is a success.

To Reproduce

Here is a link to reproduce the error. I put all the detail on how to reproduce the issue in the README

Expected behavior

No TS error.

Related information:

  System:
    OS: Windows 10 10.0.22631
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 3.93 GB / 15.74 GB
  npmPackages:
    @vue/test-utils: 2.4.1 => 2.4.1
    vitest: ^0.31.1 => 0.31.1
    vue: ^3.3.4 => 3.3.4

Additional context

@joris-fonck-loreal joris-fonck-loreal added the bug Something isn't working label Nov 23, 2023
@cexbrayat
Copy link
Member

@joris-fonck-loreal Thanks for the repro.

We have a WIP PR to have better types that should land shortly, so maybe this will fix your issue as well. You can track the progress of #2242, and check again when it is merged and released. If the issue persists, then we'll take a closer look 👍

@joris-fonck-loreal
Copy link
Author

Thanks a lot. I'm waiting for the release of the PR and I will come back to you afterwards.

Regards.

@chrisjfoss
Copy link

I am running into this issue as well. In the current state, it is difficult to work with generic components. I see there is a WIP PR to handle this, but it hasn't had any activity in the last 7 months. Is there a timeline to handle this? If not, what is preventing this from getting solved?

Thank you, really appreciate the work being put into this library!

@cexbrayat
Copy link
Member

I think we first need vuejs/core#9556 to land, then #2242 can be merged and released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-pr
Projects
None yet
Development

No branches or pull requests

3 participants