fantasticon icon indicating copy to clipboard operation
fantasticon copied to clipboard

glob 8.x breaks Windows

Open XhmikosR opened this issue 2 years ago • 13 comments

On Windows, glob 8.x has changed how results are returned and fantasticon 2.0.0 is unusable.

> [email protected] 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.

XhmikosR avatar Nov 25 '22 15:11 XhmikosR

Confirmed, I got a "No SVGs found in xxx" error on Windows. Version: 2.0.0

HoneyLuka avatar Nov 29 '22 10:11 HoneyLuka

The bug is, that glob requires slashes, but path.join() creates backslashes on windows systems. In the file src/utils/assets.ts, function loadPaths(dir), create globPath as join(dir, **/*.${ASSETS_EXTENSION}).replace(/\\/g, '/'); and it should work.

hapf avatar Jan 18 '23 17:01 hapf

The bug is, that glob requires slashes, but path.join() creates backslashes on windows systems. In the file src/utils/assets.ts, function loadPaths(dir), create globPath as join(dir, **/*.${ASSETS_EXTENSION}).replace(/\\/g, '/'); and it should work.

I just tested this, and it fixed the issue.

lucas-labs avatar Jan 20 '23 16:01 lucas-labs

The same thing is happening to me. Downgrading the version to 1.2.3 helped temporaraly.

Mirta91 avatar Feb 16 '23 11:02 Mirta91

The bug is, that glob requires slashes, but path.join() creates backslashes on windows systems. In the file src/utils/assets.ts, function loadPaths(dir), create globPath as join(dir, **/*.${ASSETS_EXTENSION}).replace(/\\/g, '/'); and it should work.

I did the same! this works..

anabwan avatar May 01 '23 07:05 anabwan

For those who want to downgrade glob but are struggling to do so (I definitely was!):

  1. Add overrides to your package.json
  "dependencies": {
    "fantasticon": "^2.0.0"
+  },
+  "overrides": {
+    "fantasticon": {
+      "glob": "7.2.0"
+   }
  }
  1. run npm 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 overrides to work

sozysozbot avatar May 06 '23 00:05 sozysozbot

Followed same steps but still getting that error :/

amitpatil321 avatar Jan 18 '24 21:01 amitpatil321

For now i downgraded it to 1.2.3, and Since I was using global instance, I just installed it globally

npm i -g [email protected]

amitpatil321 avatar Jan 19 '24 09:01 amitpatil321

For anyone encountering this bug: you can try migrating to @twbs/fantasticon instead. 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.

adidahiya avatar Jan 19 '24 12:01 adidahiya

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.

XhmikosR avatar Feb 02 '24 06:02 XhmikosR

For now i downgraded it to 1.2.3, and Since I was using global instance, I just installed it globally

npm i -g [email protected]

this worked to me! thanks

ruancs avatar Mar 19 '24 22:03 ruancs