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
58.54k stars 3.19k forks source link

[bug]: Cannot add components using the CLI because of failed certificate verification #3535

Open jakub-sekula opened 3 weeks ago

jakub-sekula commented 3 weeks ago

Describe the bug

I am trying to add the Tooltip component by running npx shadcn-ui@latest add tooltip, but the command fails with the following error message:

FetchError: request to https://ui.shadcn.com/registry/index.json failed, reason: unable to verify the first certificate
    at ClientRequest.<anonymous> (file:///C:/Users/js/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/node-fetch/src/index.js:108:11)
    at ClientRequest.emit (node:events:513:28)
    at TLSSocket.socketErrorListener (node:_http_client:496:9)
    at TLSSocket.emit (node:events:513: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: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  erroredSysCall: undefined
}
Failed to fetch components from registry.

It worked fine yesterday and nothing changed on my side, is it possible that some certificate has expired?

Affected component/components

Tooltip

How to reproduce

Run npx shadcn-ui@latest add tooltip

Codesandbox/StackBlitz link

No response

Logs

FetchError: request to https://ui.shadcn.com/registry/index.json failed, reason: unable to verify the first certificate
    at ClientRequest.<anonymous> (file:///C:/Users/js/AppData/Local/npm-cache/_npx/125ee17d583c4e03/node_modules/node-fetch/src/index.js:108:11)
    at ClientRequest.emit (node:events:513:28)
    at TLSSocket.socketErrorListener (node:_http_client:496:9)
    at TLSSocket.emit (node:events:513: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: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
  erroredSysCall: undefined
}
Failed to fetch components from registry.

### System Info

```bash
Windows 10.0.19042 Build 19042
npm 8.19.3
node 18.13.0

Before submitting

ruru-m07 commented 3 weeks ago

@jakub-sekula are you able to add those components like button input card etc... or same problem with all components add?

Widdin commented 3 weeks ago

@jakub-sekula Are you by any chance using ESET Antivirus?

https://forum.eset.com/topic/40702-eset-ssl-protection-produces-an-invalid-certificate-chain-for-nodejs-apps/

jakub-sekula commented 3 weeks ago

@jakub-sekula Are you by any chance using ESET Antivirus?

https://forum.eset.com/topic/40702-eset-ssl-protection-produces-an-invalid-certificate-chain-for-nodejs-apps/

I am actually, it's being used on my company network. I think this may be it, I'll check in with the IT people this week and let you know if and how it's solved. But it does sound like this issue is external to shadcn though.

renzonj commented 3 weeks ago

If you have access to ESET settings, you can disable the HTTPS Traffic scanning. Setup > Internet Protection > Web access protection (gear icon) > HTTP(S) traffic scanning > then turn off the HTTPS Traffic scanning