Closed mvolkmann closed 11 months ago
it will be an integration in v1 https://github.com/natemoo-re/astro-icon/releases/tag/astro-icon%401.0.0-next.0
Nice! How can I use astro-icon before that change is merged?
Hey @mvolkmann! 👋🏼 Yes, the astro add command won't work until we publish the new integration.
For now use the manual instructions but install using npm i astro-icon@next
to get the V1 changes.
I tried that, but this fails because it can't find astro-icon
.
import { Icon } from "astro-icon";
I do have an astro-icon
directory in my node_modules
directory.
I did modify astro.config.mjs
as described in the "Manual Install" documentation.
Could the issue be that the package.json
file for astro-icon
doesn't specify the main
property?
@mvolkmann you might want to check out those guides:
Getting Started | Astro Icon https://www.astroicon.dev/getting-started/
Upgrade to Astro Icon v1 | Astro Icon https://www.astroicon.dev/guides/upgrade/v1/ (in case you have an old v0.x version in your project)
Thank you, installing via npm i astro-icon@next solved for me 👍 .
By the way trying to installing a custom svg icon by putting it insto src/icons/ folder gives me this error :
Unable to load the "local" icon set!
It looks like the "local" set was not loaded.
Did you forget to create the icon directory or to update your config?
This should be resolved now that https://github.com/natemoo-re/astro-icon/pull/162 has been merged!
@pietrociatta please open a new issue for any bugs encountered using v1.0.0!
I can confirm this is working for me now. I documented the steps I used at https://mvolkmann.github.io/blog/topics/#/blog/astro/. See the "Icons" section.
I get the following when I enter
npx astro add astro-icon
:⚠ astro-icon is not an official Astro package. Use at your own risk! ✔ Continue? … yes ✖ astro-icon doesn't appear to be an integration or an adapter. Find our official integrations at https://astro.build/integrations