-
Notifications
You must be signed in to change notification settings - Fork 269
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]: [@vue/compiler-sfc] Failed to resolve extends base type. While adding button component #207
Comments
After some digging I figured that the issue might be with this utility: export async function transformByDetype(content: string, filename: string) {
return await transform(content, filename, {
removeTsComments: true,
})
} It can't convert extended interface. Maybe changing this to a |
I managed to get the component finally by moving |
Thanks for the context @hubcio2115 ! I think you are right that the transformation may be causing that issue. |
I'll look into that |
I had the exact same problem/errormsg, when I installed typescript in the project it worked |
I also have typescript installed because it's a needed dependency in a project for Volar to work. At least for me it's needed with the setup I have. |
Yes I can confirm it is working on Windows and also unix OS (StackBlitz) https://stackblitz.com/edit/github-w623yc However on Windows on first try I had error but after first try it work as excepted
Please try on latest Nuxt and Vue versions, don't stay on older versions when it's not like Vue2->Vue3 migration |
I'm also getting this error while adding button. I just setup an vue project using js and I cannot add button to my project. Here is the link to the codespace https://codespaces.new/Jahan-Shah/test Is there any solution? Note: The issue resolved after I installed radix-vue. |
Since button is using
|
Main shadcn-ui CLI also install |
Ow man You guys are right 👍 Adding |
@sadeghbarati I'm glad that helped in resolving the issue. |
I'm still getting this error when I follow Nuxt guide: https://www.shadcn-vue.com/docs/installation/nuxt.html I also tried installing radix-vue first and later executing |
Same error. How to resolve it? |
I've got the same issue on a new Nuxt project. Tried adding |
@ayaanqui Hi Are you using |
@sadeghbarati I'm using it with TS. Also, I was able to fix the issue on my end by adding an import to the button component. Looks like the auto import feature offered in Nuxt didn't work. |
I have the same problem with typescript please solve that |
Hi, Can you guys share what way you using shadcn-vue in Nuxt?
Or
|
Hello I have created a new project in NUXT3, I followed the instructions and I am still getting this error when using the button component. I selected the typescript option. Is there any temporary fix? |
My fault sorry, typescript wasn't installed as a dependency:
Now everything works |
So we tested with https://stackblitz.com/edit/vitejs-vite-1tta2g It's working fine |
still having this issue when using the default nuxt layer setup: |
You need to remove lockfile and install again, then run shadcn-vue init again Or just install missing dependencies manually Idk why it's happening, but I know sometimes lockfiles are the problems |
thanks, dude. it works! |
Got that error too now. Fresh install of shadcn using the recommended I now added the by the compiler proposed
|
Been slamming my head against the wall for some days now. Same problem as the original issue, same setup as the previous comment with |
Make sure you install typeScript as a dev dependency |
Environment
Link to minimal reproduction
https://github.com/hubcio2115/nuxt-chadcn
Steps to reproduce
components/ui
folder insrc
- because you cannot commit empty folders with gitbun i
bunx schadcn-vue-@latest add button
Describe the bug
I started a brand new project with
nuxti
, as per shadcn-vue instructions for js setup in the installation docs. Went through entire process and when I try to addbutton
with the cli I get:button
folder gets added insrc/components/ui
but it doesn't get populated with thebutton
component. It is specificallybutton
component. When I tried to addinput
,badge
andalert
it worked just fine. When I tried to installchadcn-vue
in a typescript nuxt project installingbutton
works fine.Expected behavior
chadcn-vue
Button component gets added tosrc/components/ui
with it'sindex.js
file.Conext & Screenshots (if applicable)
No response
The text was updated successfully, but these errors were encountered: