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]: AccordionRoot TS type problems with defineComponent usage #885

Open
zfeher opened this issue Apr 29, 2024 · 3 comments
Open

[Bug]: AccordionRoot TS type problems with defineComponent usage #885

zfeher opened this issue Apr 29, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@zfeher
Copy link

zfeher commented Apr 29, 2024

Environment

Developement/Production OS: Windows 10 19045.4291
Node version: 18.18.0, 20.11.0
Package manager: [email protected], [email protected]
Radix Vue version: 1.7.3
Vue version: 3.4.26
Client OS: Windows 10 19045.4291
Browser: Firefox 125.0.2, Chrome 124.0.6367.91

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-z3u3bm?file=src%2Fcomponents%2FAccordionGlitch.vue,src%2Fcomponents%2FAccordionNoGlitch.vue,package.json&terminal=dev

Steps to reproduce

1, Open repro link, wait for it to initialize
2, Open additional terminal and run npm run type:check

Describe the bug

AccordionGlitch component is authored via defineComponent and includes AccordionRoot in components. Just this triggers a long TS type error which did not happen with radix-vue 1.4.x. (the AccordionRoot component itself works just fine, the only problem is the TS type error)

Using a script setup authoring (AccordionNoGlitch) the TS type error doesn't occur, everything works as expected.

Expected behavior

No TS type error when AccordionRoot is used with defineComponent components options,

Context & Screenshots (if applicable)

No response

@zfeher zfeher added the bug Something isn't working label Apr 29, 2024
@zernonia
Copy link
Collaborator

Thanks for the issue @zfeher . Might be related to upstream vue-tsc couldn't resolves the generic type correctly.

@zfeher
Copy link
Author

zfeher commented Apr 30, 2024

Hmm we updated our vue-tsc dep to v2 at the same time as radix-vue so just in case I checked this with vue-tsc v1.8.27 as well and the error is reported with that version too (same with latest v2.0.15).

@zernonia
Copy link
Collaborator

Turns out it has something to do with the defineSlots of the component. We might need to open a ticket on vue/language-tools to raise this issue.

image

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

No branches or pull requests

2 participants