Skip to content
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

Icon not available issue #134

Closed
cernezan opened this issue Aug 5, 2023 · 3 comments
Closed

Icon not available issue #134

cernezan opened this issue Aug 5, 2023 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@cernezan
Copy link

cernezan commented Aug 5, 2023

I'm using Tabler icons on my website. I've notice that some icons are available and display correctly as expected. However when I try Mastodon icon for example (tabler:brand-mastodon), the Astro breaks and the icon isn't displayed. Am I missing something?

Error: Not Found: "brand-mastodon" in pack "tabler"
    at request (/Users/zancerne/Documents/cernezan.com/main/node_modules/astro-icon/lib/resolver.ts:17:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async get (/Users/zancerne/Documents/cernezan.com/main/node_modules/astro-icon/lib/resolver.ts:33:10)
    at async Module.load [as default] (/Users/zancerne/Documents/cernezan.com/main/node_modules/astro-icon/lib/utils.ts:153:22)
    at async eval (/Users/zancerne/Documents/cernezan.com/main/node_modules/astro-icon/lib/Icon.astro:22:17)
    at async AstroComponentInstance.render (/Users/zancerne/Documents/cernezan.com/main/node_modules/astro/dist/runtime/server/render/astro/instance.js:31:7)
    at async Module.renderChild (/Users/zancerne/Documents/cernezan.com/main/node_modules/astro/dist/runtime/server/render/any.js:33:5)
    at async EagerAsyncIterableIterator.next (/Users/zancerne/Documents/cernezan.com/main/node_modules/astro/dist/runtime/server/render/util.js:155:14)
    at async [Symbol.asyncIterator] (/Users/zancerne/Documents/cernezan.com/main/node_modules/astro/dist/runtime/server/render/astro/render-template.js:38:9)
    at async renderAstroTemplateResult (file:///Users/zancerne/Documents/cernezan.com/main/node_modules/astro/dist/runtime/server/render/astro/render-template.js:41:20)
@dwightjack
Copy link
Contributor

I encountered the same issue with the logos collection. astro-icon uses a custom service to resolve iconify icons, so I guess that service might have outdated information.

As a workaround (at least it worked for me) you can overwrite the tabler collection with a local one (documentation):

  1. Create a src/icons/tabler.ts file
  2. file contents:
    import { createIconPack } from 'astro-icon/pack';
    
    export default createIconPack({
      // directly query iconify API 
      url: 'https://api.iconify.design/tabler/',
    });
    

@cernezan
Copy link
Author

Thank you for the local setup instructions.

@stramel
Copy link
Collaborator

stramel commented Aug 14, 2023

Hi! 👋🏼 Thank you for filling this. However it is a known issue with v0 and will be fixed in v1.

I'm going to close this as a duplicate of #29

@stramel stramel added the duplicate This issue or pull request already exists label Aug 14, 2023
@stramel stramel closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants