becem-gharbi / nuxt-naiveui

Unofficial Naive UI module for Nuxt
https://nuxt-naiveui.bg.tn
MIT License
163 stars 20 forks source link

Feature Request: print error details when fetching falling #44

Closed typed-sigterm closed 9 months ago

typed-sigterm commented 9 months ago

https://github.com/becem-gharbi/nuxt-naiveui/blob/954e01a3428b571cd6bbe9fc436b0492635675b4/src/iconify-vite/index.ts#L30

This line will send request to https://raw.githubusercontent.com/iconify/icon-sets/master/collections.json. However, most people in China Mainland cannot access raw.githubusercontent.com without using a proxy.

Currently it logs this:

 ERROR  [iconify-download-icons] fetch failed
 ERROR  Nuxt Build Error: fetch failed
              <stack trackback>

If adding the url (COLLECTIONS_URL) in the error message, we, Chinese developers will realize that we need to use a proxy.

becem-gharbi commented 9 months ago

Hi, thanks for pointing to this issue. Actually, I didn't know about it.

The fetch solution is made in order to sync with latest Iconify icon-sets changes. For better DX, I have created a web service that acts as a proxy to https://raw.githubusercontent.com/iconify/icon-sets/master/collections.json.

https://iconify-icon-sets.vercel.app