natemoo-re / astro-icon

Inline and sprite-based SVGs in Astro made easy!
https://astroicon.dev
Other
1.12k stars 62 forks source link

not an integration? #167

Closed mvolkmann closed 11 months ago

mvolkmann commented 11 months ago

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

myakura commented 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

mvolkmann commented 11 months ago

Nice! How can I use astro-icon before that change is merged?

stramel commented 11 months ago

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.

mvolkmann commented 11 months ago

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?

myakura commented 11 months ago

@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)

pietrociatta commented 11 months ago

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?
natemoo-re commented 11 months ago

This should be resolved now that https://github.com/natemoo-re/astro-icon/pull/162 has been merged!

natemoo-re commented 11 months ago

@pietrociatta please open a new issue for any bugs encountered using v1.0.0!

mvolkmann commented 11 months ago

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.