fantasticon: glob 8.x breaks Windows
On Windows, glob 8.x has changed how results are returned and fantasticon 2.0.0 is unusable.
> bootstrap-icons@1.10.2 icons-font
> fantasticon
No SVGs found in ./icons
ERROR: "icons-font" exited with 1.
I suggest that you either downgrade glob or normalize backslashes yourself. I personally just don’t update glob to 8.x.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 15
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Downgrade to fantasticon 1.2.3 Due to https://github.com/tancredi/fantasticon/issues/470 — committed to sozysozbot/geometric_linzklar by sozysozbot 4 years ago
- Downgrade to fantasticon 1.2.3 Due to https://github.com/tancredi/fantasticon/issues/470 — committed to sozysozbot/linmarn_font_project_tentative_temporary by sozysozbot 4 years ago
- Migrate to @twbs/fantasticon As suggested by https://github.com/tancredi/fantasticon/issues/470#issuecomment-1900362895 — committed to sozysozbot/gy1_bet2_pmcp_font by sozysozbot 3 years ago
- fantasticon から @twbs/fantasticon へお引越し もともとの fantasticon がメンテされなくなったので、 https://github.com/tancredi/fantasticon/issues/470#issuecomment-1900362895 にある通り引っ越すことになった — committed to AIL-MO-LETI-CEP/syt2_ten1_pmcp_font by sozysozbot 3 years ago
- fantasticon から @twbs/fantasticon に引っ越し 経緯: https://github.com/tancredi/fantasticon/issues/470#ref-pullrequest-1990833943 — committed to sozysozbot/lin-marn-bitmap-font by sozysozbot 3 years ago
- fantasticon を @twbs/fantasticon に 理由: https://github.com/tancredi/fantasticon/issues/470#ref-pullrequest-1990833943 — committed to sozysozbot/nun1_aik2_pmcp_font by sozysozbot 3 years ago
- fantasticon を @twbs/fantasticon にする 経緯: https://github.com/tancredi/fantasticon/issues/470#ref-pullrequest-1990833943 — committed to sozysozbot/linzklar-mincho by sozysozbot 3 years ago
- fantasticon から @twbs/fantasticon に移行 経緯: https://github.com/tancredi/fantasticon/issues/470#ref-pullrequest-1990833943 — committed to sozysozbot/geometric_linzklar by sozysozbot 3 years ago
- fix: fixed can't find any svg in windows due to glob replace `fantasticon` to `@twbs/fantasticon` ref https://github.com/tancredi/fantasticon/issues/470#issuecomment-1900362895 — committed to yue1123/vite-plugin-supericon by yue1123 2 years ago
- Fix issue #470 — committed to ramirezcgn/fantasticon by ramirezcgn a year ago
Confirmed, I got a “No SVGs found in xxx” error on Windows. Version: 2.0.0
For anyone encountering this bug: you can try migrating to
@twbs/fantasticoninstead. The bootstrap team has forked fantasticon and worked around this issue. It seems like this original fantasticon package is no longer maintained. I migrated my project 2 months ago and it’s been working well so far.Soon 2025…
The bug is, that
globrequires slashes, butpath.join()creates backslashes on windows systems. In the filesrc/utils/assets.ts, functionloadPaths(dir), createglobPathasjoin(dir,**/*.${ASSETS_EXTENSION}).replace(/\\/g, '/');and it should work.I was really hoping we could upstream our patches, since they are mostly trivial but improve things nevertheless (comparison). Unfortunately, last time I tried upstreaming the patches, I didn’t succeed so I have to keep the fork around for the time being.
For those who want to downgrade glob but are struggling to do so (I definitely was!):
overridesto your package.jsonnpm uninstall fantasticon && npm install fantasticon(According to https://github.com/npm/cli/issues/4232#issuecomment-1367900280 , you need to explicitly uninstall and reinstall fantasticon for the
overridesto workFor now i downgraded it to 1.2.3, and Since I was using global instance, I just installed it globally
npm i -g fantasticon@1.2.3✅ Fix for Windows “No SVGs found” error in Fantasticon. (Helped for me)
Open: node_modules/fantasticon/lib/utils/assets.js
Find the function::
const loadPaths = (dir) => ...Replace this line inside it:
const globPath = path.join(dir,**/*.${exports.ASSETS_EXTENSION});With this (Windows fix):
const globPath = path.join(dir,**/*.${exports.ASSETS_EXTENSION}).replace(/\\/g, '/');This converts backslashes to forward slashes for glob to work correctly on Windows.
🎯 That’s it!