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

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

Open
FairyPenguin opened this issue Feb 6, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@FairyPenguin
Copy link

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
Copy link
Author

EvenIcons in the src/icons folder directly affected too

@stramel stramel added the bug Something isn't working label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants