natemoo-re / astro-icon

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

[v1] local Capitalized icons are imported as lowercase on macOS #189

Open cbasje opened 5 months ago

cbasje commented 5 months ago

What version of astro-icon are you using?

v1.0.2

Astro Info

Astro                    v3.6.4
Node                     v21.0.0
System                   macOS (arm64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             none

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

No response

Describe the Bug

I have a set of local SVG icons that have capitalized names. On my laptop running macOS, the icons were unexpectedly imported as lowercase names and I could use the lowercase names in the <Icon> component. However, when I built and deployed my website to my Fly.io machine (which I think runs Debian Linux), the icons were imported with the real capitalized names. I assume this is because macOS has a case-insensitive file system? The Stackblitz example also does not have this issue.

What's the expected result?

This is not a big problem at all but I just wanted to mention it. For now, I fixed it running the command in https://stackoverflow.com/questions/7787029/how-do-i-rename-all-files-to-lowercase. I think it would be nice if the astro-icon package itself automatically imported all local icons with lowercase names to keep the format similar to iconify icons, etc. Or maybe it could at least warn people about this issue when on macOS.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-fjance?file=src%2Fpages%2Findex.astro

natemoo-re commented 5 months ago

I agree, it would be helpful to normalize the case for any references.

Sometimes issues like this are caused by a mismatch between the case sensitivity of git and the case sensitivity of your filesystem.