We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
https://github.com/gyenabubakar/repro-shadcn-nuxt-aliases-not-working
In the reproduction repo, you will see that I have a minimal Nuxt project which configures a path alias: shadcn -> ./_shadcn.
shadcn -> ./_shadcn
In the components.json file, the path aliases have been configured this way:
components.json
{ "ui": "shadcn", "components": "shadcn/components", "composables": "shadcn/_composables", "lib": "shadcn/_lib", "utils": "shadcn/utils" }
And the nuxt.config.ts file reflects this intent too. Note that, I moved the utils.ts file into the _shadcn directory.
nuxt.config.ts
utils.ts
_shadcn
When I attempt to add the Button component:
npx shadcn-vue@latest add button
...this is what happens:
# ...installation logs ? The folder _shadcn already exists. Would you like to overwrite? › (y/N)
Pressing the Y key creates _shadcn/Button.vue and _shadcn/index.ts files. These files are supposed to be in _shadcn/button directory.
Y
_shadcn/Button.vue
_shadcn/index.ts
_shadcn/button
System: OS: macOS 15.4.1 CPU: (10) arm64 Apple M1 Pro Memory: 158.45 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node Yarn: 1.22.22 - ~/.yarn/bin/yarn npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm pnpm: 9.7.1 - /opt/homebrew/bin/pnpm bun: 1.2.2 - ~/.bun/bin/bun Browsers: Brave Browser: 135.1.77.100 Chrome: 135.0.7049.96 Safari: 18.4 npmPackages: @vueuse/core: ^13.1.0 => 13.1.0 nuxt: ^3.16.2 => 3.16.2 shadcn-nuxt: ^2.1.0 => 2.1.0 vue: ^3.5.13 => 3.5.13
The text was updated successfully, but these errors were encountered:
#1102
Sorry, something went wrong.
No branches or pull requests
Reproduction
https://github.com/gyenabubakar/repro-shadcn-nuxt-aliases-not-working
Describe the bug
In the reproduction repo, you will see that I have a minimal Nuxt project which configures a path alias:
shadcn -> ./_shadcn
.In the
components.json
file, the path aliases have been configured this way:And the
nuxt.config.ts
file reflects this intent too. Note that, I moved theutils.ts
file into the_shadcn
directory.The Bug
When I attempt to add the Button component:
...this is what happens:
Pressing the
Y
key creates_shadcn/Button.vue
and_shadcn/index.ts
files. These files are supposed to be in_shadcn/button
directory.System Info
Contributes
The text was updated successfully, but these errors were encountered: