Hi there!
I see on our backend that you have filled out a support ticket, and the team is currently investigating it.
Feel free to share any insight to the community when your request is solved! 🙂
From my side everything works as expected. The getAvailableLibraryVariableCollectionsAsync
returns a non-zero length array.
Does the library have published variables? Have you tried republishing it?
Will let you know once there is a solution. Still not working at this moment.
Currently, there appears to be an issue when starting Figma. TeamLibrary variables are not loading using the code above.
To resolve this, I can toggle the mode for an instance from the TeamLibrary that is in the design file. After toggling the mode of that instance from the TeamLibrary, then the TeamLibrary variables may be loaded using the code above.
How to replicate issue: try restarting Figma and running the code above. Expect that will enable you to see the issue at play.
It would be good to have this resolved at the Figma system level.
A work-around for now is to:
When running the code, have an instance from the TeamLibrary dropped onto the page, toggle the mode, remove that instance. This hack effectively implements what is needed to invoke awareness / loading of the TeamLibrary variables.
Anything new with getting this one solved?
I’m facing the same issue now. My working code all of a sudden stopped working! The work-around also does not work for me…
Any info about this one?
console.log("Fetching library variable collections...");
const libraryCollections = await figma.teamLibrary.getAvailableLibraryVariableCollectionsAsync();
console.log("Library collections:", libraryCollections);
I have this code and this returns me empty array as well. But I clearly have libraries added and I am able to add components from there and also drag drop on the same file where I am running this plugin.