-
Notifications
You must be signed in to change notification settings - Fork 319
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]: Failed to fetch styles from registry #467
Comments
@Epxir Can you share your |
node v20.11.0,npm 10.2.4, |
Only proxy is not available. You can use vpn and other modes, such as tun mode of clash. hope it will be useful. |
I had the same problem, vpn can access the Internet but can not execute the |
Try
Then, use it without npx like
See if it's works |
I'm having the same problem, installing the tool globally and running without npx does not fix the problem
tried setting |
I've encountered the same issue while trying to install the resizable component pnpx shadcn-vue@latest add resizable ERROR [GET] "https://www.shadcn-vue.com/registry/colors/blue.json": 404 Not Found 4:33:03 PM
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async $fetch2 (/Users/NuxtIsAwesome/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/ofetch/dist/shared/ofetch.00501375.mjs:261:15)
at async /Users/NuxtIsAwesome/Library/pnpm/global/5/.pnpm/[email protected][email protected]/node_modules/shadcn-vue/dist/index.js:443:26
at async Promise.all (index 0)
at async fetchRegistry (/Users/NuxtIsAwesome/Library/pnpm/global/5/.pnpm/[email protected][email protected]/node_modules/shadcn-vue/dist/index.js:441:21)
at async getRegistryBaseColor (/Users/NuxtIsAwesome/Library/pnpm/global/5/.pnpm/[email protected][email protected]/node_modules/shadcn-vue/dist/index.js:395:22)
at async Command.<anonymous> (/Users/NuxtIsAwesome/Library/pnpm/global/5/.pnpm/[email protected][email protected]/node_modules/shadcn-vue/dist/index.js:509:23)
ERROR Failed to fetch base color from registry. 4:33:03 PM
I noticed the url is actually a 404. If you visit “https://www.shadcn-vue.com/registry/colors/blue.json”. Which is what the tool is trying to access. So it makes sense it fails. After reading the previous comments, I also tried installing shadcn-vue globally and using that, but it's still the same error. Happy to provide any other info that might help with debugging. |
@MrSunshyne can you check your |
@zernonia you're correct ! {
"$schema": "https://shadcn-vue.com/schema.json",
"style": "default",
"typescript": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "assets/css/tailwind.css",
- "baseColor": "blue",
"cssVariables": true
},
"framework": "nuxt",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
} I can see 'blue' in |
Do we have any workaround for this proxy issue? It would be really nice to use npx to add and update components... @Epxir I would assume this is only related to people working behind a proxy, so maybe include that in the title? |
Many countries and regions may have special network environments. The website read inside the npx running script may not be affected by the proxy. You need to make the global network take over by the proxy program. Environment variables will not work. |
@Epxir not sure if I understand. As I see it it is the npx script reading the json file that does not use the proxy configured by environmentvariables or passed into it. Could it be possible to modify the npx script to accept a proxy setting? |
Modifying the script is not an easy way,use a VPN or other global proxy tool to hijack all network connections. |
Website or registry files are on Cloudflare pages there are a lot of reasons that might happen like bad caching or other errors on server which I'm not aware of Using DNS or VPN might help resolve this issue |
it's a bad design as a package to fetch something from 3rd party site. |
It seems to be the ofetch that causes the problem, its doesn't care much about environment variables such as http_proxy, nuxi also has a similar problem using ofetch, in my environment (linux or wsl2 on windows) I can use proxychains as a workaround.
|
Reproduction
1
Describe the bug
I found shadcn-ui/ui#1371 it doesnt solve the problem,is it due to differences in projects?
System Info
Contributes
The text was updated successfully, but these errors were encountered: