Figma TeamLibrary Variables Functions not working

The following code used to work:

var libraryCollections = await Figma.teamLibrary.getAvailableLibraryVariableCollectionsAsync();
console.log(‘libraryCollections…’);
console.log(libraryCollections);

Right now, it is not working and simply returns an empty array.

Is there a new bug in Figma?

Team libraries are enabled.

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! :slight_smile:

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?