shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
70.68k stars 4.25k forks source link

[bug]: bunx --bun shadcn-ui@latest add table #3682

Open duran-0519 opened 4 months ago

duran-0519 commented 4 months ago

Describe the bug

ConnectionClosed: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch() path: "https://ui.shadcn.com/registry/index.json"

Failed to fetch components from registry.

Affected component/components

table

How to reproduce

bunx --bun shadcn-ui@latest add table FetchError: request to https://ui.shadcn.com/registry/index.json failed, reason: read ECONNRESET at ClientRequest. (file:///private/tmp/bunx-501-shadcn-ui@latest/node_modules/node-fetch/src/index.js:108:11) at ClientRequest.emit (node:events:514:28) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { type: 'system', errno: 'ECONNRESET', code: 'ECONNRESET', erroredSysCall: 'read' } Failed to fetch components from registry.

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

macOS Monterey 12.7.4

Before submitting

duran-0519 commented 4 months ago

node -v v20.10.0 bun -v 1.1.4

lubosmato commented 3 months ago

I got similar error. I accidentally ran yarn install in my bun project folder which added "packageManager": "..." into package.json and forgot about it.

This confused package manager detection and bunx --bun shadcn-ui@latest add ... command then uses yarn package manager.

I fixed it by removing all yarn mentions (yarn.lock, packageManager in package.json, ...) and re-run bunx --bun shadcn-ui@latest add ....