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]: v0.10.5 - Unable to add components using npx #560

Open
2 tasks
philliphartin opened this issue May 21, 2024 · 22 comments
Open
2 tasks

[Bug]: v0.10.5 - Unable to add components using npx #560

philliphartin opened this issue May 21, 2024 · 22 comments
Labels
bug Something isn't working

Comments

@philliphartin
Copy link

Reproduction

Use the CLI

Describe the bug

Since the latest release the npx shadcn-vue@latest add tabs helper no longer works.
Currently using 0.10.4 to keep functionality going.

System Info

System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 153.47 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    npm: 10.4.0 - ~/.nvm/versions/node/v20.11.0/bin/npm
    bun: 1.1.3 - ~/.bun/bin/bun
  Browsers:
    Chrome: 124.0.6367.208
    Safari: 17.5
  npmPackages:
    @vueuse/core: ^10.9.0 => 10.9.0 
    nuxt: ^3.11.2 => 3.11.2 
    radix-vue: ^1.7.4 => 1.7.4 
    shadcn-nuxt: ^0.10.4 => 0.10.4 
    vue: ^3.4.27 => 3.4.27

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@philliphartin philliphartin added the bug Something isn't working label May 21, 2024
@sadeghbarati
Copy link
Collaborator

@philliphartin JS or TS project?

@philliphartin
Copy link
Author

It was a TS project (Nuxt)

@petertsoisstuff
Copy link

petertsoisstuff commented May 21, 2024

Same here on nuxt project(tried npm, pnpm, bun), I think this is a bug of v0.10.5.
When I follow documentation using npx shadcn-vue@latest add label it shows below success message.

√ Component button already exists. Would you like to overwrite? ... yes
✔ Done.

but cannot find files in components/ui directory.

npx shadcn-vue@v0.10.4 add label works fine.

@Grinch3214
Copy link

Grinch3214 commented May 21, 2024

Same problem.
npx shadcn-vue@v0.10.4 add label works fine.

@omar-labana
Copy link

same using node v20.13.1

@DarkZeus
Copy link

Same here

  • Nuxt 3.11.2
  • Node v20.13.1
  • pnpm 9.1.2

@chachew
Copy link
Contributor

chachew commented May 21, 2024

Same issue for me with Nuxt and shadcn-vue@latest. Works fine with v0.10.4

@zernonia
Copy link
Contributor

Hey guys.. I've just tested on Stackblitz using v0.10.5 and latest Nuxt, seems to be fine tho 🤔
https://stackblitz.com/edit/github-iqfvjd?file=package.json

@petertsoisstuff
Copy link

Maybe it only happens on Windows? I'm not sure what environment StackBlitz uses.

@sadeghbarati
Copy link
Collaborator

sadeghbarati commented May 22, 2024

Tested on Windows 11 it's working with v0.10.5

Nuxt/TS project

image

@Grinch3214
Copy link

Grinch3214 commented May 22, 2024

Tested on Windows 11 it's working with v0.10.5

image

Indicates success and the component is downloaded to the desktop, and not to the project (Windows 10)

@sadeghbarati
Copy link
Collaborator

If you are in Nuxt/JS project this issue might help (component added outside of the project directory)

#291 (comment)

@ShuviSchwarze
Copy link

If you are in Nuxt/JS project this issue might help (component added outside of the project directory)

#291 (comment)

For my case (Nuxt/TS) the components were being added to the parent dir, this solution did fix the issue with detecting root dir.

@diakonovm
Copy link

If you are in Nuxt/JS project this issue might help (component added outside of the project directory)
#291 (comment)

For my case (Nuxt/TS) the components were being added to the parent dir, this solution did fix the issue with detecting root dir.

Did not fix the issue for me.

@zernonia
Copy link
Contributor

@diakonovm can you share what kind of error message you got? We need more details in what is the root cause of this issue

@kawoki
Copy link

kawoki commented May 24, 2024

If you are in Nuxt/JS project this issue might help (component added outside of the project directory)

#291 (comment)

Got the same problem as well and this did not work for me but I was able to make it work by deleting the node_modules folder then re-run pnpm install. After that, I was able to download the component.

Hope this solve your problem as well.

Nuxt: 3.11.2
Shadcn-nuxt: 0.10.4
Node: v22.2.0
pnpm: 9.0.5

@gregmsanderson
Copy link
Contributor

I've been finding the same as the above.

Neither the linked #291 nor deleting the node_modules fixed it.

As above, when I run npx shadcn-vue@latest add sonner tooltip the CLI still runs, it says it is successful ... but now the component is no longer installed in the /components/ui folder (with the rest) but instead get added to the parent folder, in a newly created sibling components/ui folder. Weird! For now I have just manually moved them and then deleted that folder.

Nuxt app, on a Mac, using npm.

@kawoki
Copy link

kawoki commented May 25, 2024

Just tried it again and it only works when #291 (comment) is added to the nuxt.config.ts then deleting the node_modules and running pnpm install

@ejirocodes
Copy link

If you are in Nuxt/JS project this issue might help (component added outside of the project directory)
#291 (comment)

For my case (Nuxt/TS) the components were being added to the parent dir, this solution did fix the issue with detecting root dir.

This seems to work

@gregmsanderson
Copy link
Contributor

@kawoki Ah ... yes! Thanks. The order matters.

@sadeghbarati
Copy link
Collaborator

Daniel Roe quote

There are a number of reasons we choose not to set baseURL, including the fact that typescript recommends against it.
Let's see if we can fix the upstream issue another way.

@sugoidesune
Copy link

sugoidesune commented Jun 15, 2024

i made an npm command that moves the folders for windows.
//package.json

 "shadcnmove": "robocopy \"C:\\Users\\USER_NAME\\code\\components\\ui\" \"C:\\Users\\USER_NAME\\code\\PROJECT_NAME\\components\\ui\" /move /e",

after install i run npm run shadcnmove

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