Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[bug]: Shadcn CLI doesn't realize the text-based bun lockfile "bun.lock", always use npm.(Next 15) #6363

Open
2 tasks done
ivan88217 opened this issue Jan 15, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@ivan88217
Copy link

Describe the bug

I'm using next 15 with bun.
It worked well until I upgraded my bun to a text-based lockfile.

After I changed the archive bun.lock to a text-based lockfile bun.lock and removed bun.lockb, the shadcn CLI will always use npm instead of bun.
I tried re-adding bun.lockb and it worked, so I'm guessing that only bun.lockb is being recognized and not bun.lock

Before adding bun.lockb, only bun.lock
image

After adding bun.lockb
image

Affected component/components

all

How to reproduce

  1. following Bun text-based lockfile doc to use text-based lockfile
  2. use shadcn cli to add component bunx --bun shadcn@latest add checkbox in Next 15 project.
  3. It will show npm error
  4. copy bun.lock and rename to bun.lockb
  5. add component again bunx --bun shadcn@latest add checkbox
  6. It worked, and with bun

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

OS: Mac OS 15.0.1(24A348)
Shell: zsh
Runtime: bun 1.1.43
Framework: Next 15 with react 19

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@ivan88217 ivan88217 added the bug Something isn't working label Jan 15, 2025
@jonz94
Copy link

jonz94 commented Jan 15, 2025

I just looked into this, and it seems that PR #6152 will resolve the issue.

@ShaharIlany
Copy link

For now, if you already upgraded to bun v1.2 you can just run rm bun.lock && touch bun.lockb && bun i, It will return the binary lock file and you will be able to use shadcn cli tool with bun as the package manager

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

No branches or pull requests

3 participants