I am trying to get importComponentSetByKeyAsync function to work on my team library but I’m struggling with the console errors, they don’t give much context as to why my component key isn’t working
figma_app.min.js.br:4 TypeError: not a function
at <anonymous> (PLUGIN_65_SOURCE:6)
at forEach (native)
at <anonymous> (PLUGIN_65_SOURCE:11)
at call (native)
at <eval> (PLUGIN_65_SOURCE:18)
If I use figma.importComponentSetByKeyAsync I get:
Preformatted text`figma_app.min.js.br:14 GET https://www.figma.com/api/design_systems/library/state_group/119e7b07f75105e047eaedb8e4b9ef5b61350ead?fv=15 404
You are probably trying to do something with newComponent on the next line and it doesn’t exist yet because you are not waiting for the async function to complete.
Is this the full code of the plugin or is there something else like figma.closePlugin() after these lines? If you close the plugin before .then() in the promise finishes, it won’t write anything to console.
Did you enable Developer VM?
The syntax error is pretty self-explanatory, you probably have some extra or missing bracket somewhere.