FlorianWoelki / obsidian-iconize

Simply add icons to anything you want in Obsidian.
https://florianwoelki.github.io/obsidian-iconize/
MIT License
848 stars 57 forks source link

Icon not found via note Properties ("Error: Icon [icon name] could not be found") #383

Open FitzFrobozz opened 7 months ago

FitzFrobozz commented 7 months ago

Upon entering a valid icon name in my icon property, an error appears stating that the icon cannot be found, despite the icon file being present in the <vault>\.obsidian\icons\lucide-icons directory. (Obsidian 1.5.8.)

Steps to reproduce the behavior:

  1. Enable Use icon in frontmatter in settings
  2. Create an icon property
  3. Create or edit a note and specify an icon for that property

Expected behavior: Icon is recognized and used.

Console:

Error: Icon cassette-tape could not be found.
    at saveIconToIconPack (plugin:obsidian-icon-folder:2656:15)
    at IconFolderPlugin.eval (plugin:obsidian-icon-folder:5740:29)
    at Generator.next (<anonymous>)
    at eval (plugin:obsidian-icon-folder:34:71)
    at new Promise (<anonymous>)
    at __awaiter (plugin:obsidian-icon-folder:30:12)
    at eval (plugin:obsidian-icon-folder:5718:79)
    at e.tryTrigger (app.js:1:717538)
    at e.trigger (app.js:1:717471)
    at t.trigger (app.js:1:1775016)
eval @ plugin:obsidian-icon-folder:5744

Line 5744:

                    catch (e) {
                        console.error(e);
                        new obsidian.Notice(e.message);
                        return;
                    }
FlorianWoelki commented 7 months ago

heyhey, thanks for the report. do you use a custom icon pack?

FitzFrobozz commented 7 months ago

heyhey, thanks for the report. do you use a custom icon pack?

Hey there. I have in the past, but when I ran across this issue I was only using Lucide (enabled normally via the plugin settings).

yintzgit commented 4 months ago

hey, same issue here ...

iljapanic commented 3 months ago

I've run into a similar issue when trying to use Lucide icon pack via properties.

My issue was using a wrong file name. I've set the icon property based on the Iconize default icon picker, which uses full name incl. spaces. But the icon property seems to expect a shortened icon name

🔴 This doesn't work: Folder (Li)

🟢 This works: LiFolder

Maybe this helps someone.