antfu / vscode-iconify

πŸ™‚ Iconify IntelliSense for VS Code
https://marketplace.visualstudio.com/items?itemName=antfu.iconify
MIT License
464 stars 34 forks source link

Error fetching icon data #14

Closed a1mersnow closed 2 years ago

a1mersnow commented 2 years ago

Version: 0.2.2

I use unplugin-icons(perhaps not related):

export default defineConfig({
  plugins: [
    icons({
      // auto install icons when importing
      autoInstall: true,
      compiler: 'vue3',
      defaultClass: 'iconify',
    }),
    components({
      resolvers: [
        // auto import icons while using as component, combined with `autoInstall`
        iconsResolver({}),
      ]
    }),
  ],
})

use it in template like this:

<i-mdi-account-circle />
<i-mdi-light-alarm-plus />

error in console:

🈢 Activated, v0.2.2
πŸŽ› 108 icon sets loaded
☁️ [mdi] Downloading from https://raw.githubusercontent.com/iconify/collections-json/master/json//mdi.json
πŸ› ERROR: Error: Request failed with status code 400
Error: Request failed with status code 400
    at createError (/Users/orange/.vscode/extensions/antfu.iconify-0.2.2/index.js:3323:19)
    at settle (/Users/orange/.vscode/extensions/antfu.iconify-0.2.2/index.js:3339:16)
    at IncomingMessage.handleStreamEnd (/Users/orange/.vscode/extensions/antfu.iconify-0.2.2/index.js:5044:15)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

It seems the request url https://raw.githubusercontent.com/iconify/collections-json/master/json//mdi.json is wrong(double /)

which get the response:

<a href="/iconify/collections-json/master/json/mdi.json">Moved Permanently</a>.
Thy3634 commented 2 years ago

I got the same issue.

☁️ [mdi] Downloading from https://raw.githubusercontent.com/iconify/collections-json/master/json//mdi.json
πŸ› ERROR: Error: getaddrinfo ENOENT raw.githubusercontent.com
Error: getaddrinfo ENOENT raw.githubusercontent.com
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
likui628 commented 2 years ago

seems like https://github.com/antfu/vscode-iconify/issues/7