natemoo-re / astro-icon

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

Astro Icons not properly being found when integration comes as part of a library #240

Open windmillcode0 opened 1 month ago

windmillcode0 commented 1 month ago

What version of astro-icon are you using?

v1.1.1

Astro Info

Astro                    v4.15.10
Node                     v20.17.0
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/starlight

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

So it seems even though I added the icon integration and the library install the required packages in its dependencies it still claim to not be able to find the icon set

What's the expected result?

find the icon set and the side bar shows nothing but a chevron as intended The miminal repo is here https://github.com/windmillcode0/astro-icon-in-astro-lib-issue because it would be rather hard to install a library in stackblitz via npm link

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-vtd3jq?file=issue-lib%2Foverrides%2FSidebar.astro

windmillcode0 commented 1 month ago

I referenced this issue to no avail https://github.com/natemoo-re/astro-icon/issues/171

windmillcode0 commented 1 month ago

Greetings found the issue so it looks like you just need to mention (not even install) "@iconify-json/mdi": "^1.1.68", "@iconify/json": "^2.2.239", in the package.json of the consumer not the library, this is a terrible way of doing things I believe the library should look up node_modules and not at all reference the consumer package.json if its indeed looking for the iconset