Skip to main content

I’ve been using figma.fileKey in an internal Figma plugin to get the file’s latest contributor, and it had been working fine until today.

Now I’m getting the following error:
Unhandled promise rejection: Error: figma.fileKey is undefined. Ensure you’re in the plugin main thread on API v1.0.0+

Just wanted to check—was there a recent update to the Figma APIs that may have affected this behavior? I’m running this from the main thread, so this change seems unexpected.

Appreciate any insight you can provide!

Thank you for the help

Hey ​@Vignesh Sankaran, thank you for flagging this!

I checked internally with our engineering team, and it looks like we don’t have an error message matching the string: “Ensure you're in the plugin main thread on API v1.0.0+”.

To help us investigate this further, could you share a bit more context or a reproduction if possible? That would go a long way in helping our team dig in and figure out what might be happening.

Appreciate your help! 🙏🏼


Hey @Celine_ you’re absolutely right, my apologies for the confusion earlier. It turns out it was an old callback we had manually modified a while back and completely forgot about! The root cause was that the plugin was mistakenly set to public, which is why figma.fileKey returned as undefined.

The issue is now resolved. Really appreciate you jumping in so quickly, thank you again for your time and help!


Thanks for the update, I’m glad to hear you were able to identify the issue and get it resolved!
You're absolutely right: accessing the  fileKey isn’t possible from a public plugin.

I’ve gone ahead and marked the topic as solved and closed it out. Thank you! 


my public figma plugin is unable to get figma.fileKey in production, returns undefined but works in development


Reply