astro-icon icon indicating copy to clipboard operation
astro-icon copied to clipboard

Sub-folders icons doesn't work unless the dev server restarted

Open FairyPenguin opened this issue 1 year ago • 2 comments

What version of astro-icon are you using?

"^1.0.2"

Astro Info

> astro "info"

Astro                    v4.3.1
Node                     v20.9.0
System                   Linux (x64)
Package Manager          pnpm
Output                   server
Adapter                  none
Integrations             @astrojs/react
                         astro-icon

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

No response

Describe the Bug

I followed the guide from the docs Here: https://www.astroicon.dev/getting-started/

to organize my icons I add them in a subfolder, but once I add a new SVG file, It's not detected by the Astro path as the module is not found the only solution is to restart the dev server

Note: I use inline SVG, I paste the code in .SVG file and use it like this

import { Icon } from 'astro-icon/components' <Icon name='product/CartSvg' width={24} height={24} /> The Folder looks like this src/icons/**/* image

Error: 02:04:58 [ERROR] Unable to locate "product/CartSvg" icon!

What's the expected result?

As I understand it should be detected and can be used without the need to restart every time I add a new SVG Icon.

Link to Minimal Reproducible Example

https://github.com/FairyPenguin/astro-reproduce

FairyPenguin avatar Feb 06 '24 00:02 FairyPenguin

EvenIcons in the src/icons folder directly affected too

FairyPenguin avatar Feb 06 '24 00:02 FairyPenguin

Facing the same problem in version 1.1.0

romuloaps avatar Aug 02 '24 14:08 romuloaps