Open theDeal opened 1 month ago
Here is an example of the this bug
@KingAdeCode @theDeal Hello guys, could you please provide a reproduction, everything seems to work fine for me: https://stackblitz.com/edit/shadcn-nuxt-3-13?file=components%2Fui%2Fbutton%2FButton.vue
Also created public repo, link, you can fork it and install locally, no errors are inside my vs code 🤔
https://github.com/user-attachments/assets/4625a7e4-3e30-4556-bfca-0ba3a302b698
I couldn't reproduce the error on the latest nuxt/vue version. If you still encounter the issue, please provide a minimal reproduction Thanks!
Reproduction
// todo
Describe the bug
Description:
After upgrading to the latest version of Nuxt, developers are experiencing type-related issues when using Shadcn UI components. The types provided by Shadcn UI for Vue/Nuxt seem to be incompatible or not functioning as expected, leading to development warnings and potential runtime errors.
Steps to Reproduce:
Initialize a new Nuxt project or upgrade an existing one to the latest version: bash npx nuxi@latest upgrade --force Install Shadcn UI for Vue/Nuxt: bash npx shadcn-vue@latest init Add a Shadcn UI component (e.g., Button) to a page or component: vue
Observe the development environment for type warnings or errors.
Expected Behavior:
No type errors or warnings should appear when using Shadcn UI components. Components should be fully type-safe and integrate seamlessly with Nuxt's latest TypeScript enhancements.
Actual Behavior:
Type errors or warnings are displayed in the console or during build time, indicating that the types from Shadcn UI are not compatible with the current Nuxt TypeScript configuration.
Additional Context: Recent changes in Nuxt and Vue's TypeScript handling might be contributing to this issue, particularly with how global components and custom properties are typed. There might be a need for Shadcn UI to update its type declarations to align with the new recommendations for Vue TypeScript changes.
Workaround:
For developers facing this issue, you might temporarily resolve this by adding a declarations.d.ts file in your project root with:
https://nuxt.com/blog/v3-13#vue-typescript-changes
Request:
Please update Shadcn UI's type definitions to be compatible with the latest Nuxt.js version or provide guidance on how to correctly configure TypeScript for projects using both Shadcn UI and the latest Nuxt framework.
Additional Notes:
This issue might require coordination with the Vue/Nuxt community to ensure compatibility with the new TypeScript changes in Vue. Any assistance in creating PRs or further diagnosing the issue would be
System Info
Contributes