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

icons.rootDir is not a function #5

Open
J-env opened this issue Oct 23, 2022 · 6 comments
Open

icons.rootDir is not a function #5

J-env opened this issue Oct 23, 2022 · 6 comments

Comments

@J-env
Copy link

J-env commented Oct 23, 2022

image

@cyberalien
Copy link
Member

Sorry, ignore my previous reply. You have posted issue to wrong repository, this is for @iconify/json-tools package.

rootDir() doesn't exist in new version. Use locate():

const { locate } = require('@iconify/json');
return locate(name);

@muety
Copy link

muety commented Nov 13, 2022

Could someone have a look into fixing this, please? :)

@cyberalien
Copy link
Member

There is nothing to fix. You are trying to use function that doesn't exist, but there is a different function. See example above.

@muety
Copy link

muety commented Nov 13, 2022

Sure, but I'm not using the non-existing function myself, but it's rather called inside findIconifyCollection(), so would require an update to the json-tools library.

@cyberalien
Copy link
Member

Thanks! Now it makes sense.

This package has version 1 of @iconify/json as dependency, where that function exists. In version 2 it no longer exists, so with intended version it does work correctly.

This package is deprecated and no longer maintained, though I forgot to update readme file to mention it and to archive it.

I'll probably see if it can be updated to support both versions. If it works, I'll publish update. However, package will still be marked as deprecated.

@muety
Copy link

muety commented Nov 13, 2022

Alright, I see! As a quick workaround for people, who still want to keep using their scripts, I figured that you can also just replace collection.loadIconifyCollection(name) by collection.loadFromFile(locate(prefix)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants