Skip to main content
Question

Uncaught (in promise) RuntimeError: function signature mismatch

  • July 30, 2021
  • 8 replies
  • 4678 views

Nikita_Jerschow

Running pretty much any asynchronous code will result in the error:

Uncaught (in promise) RuntimeError: function signature mismatch

Is my env setup wrong? I’ve gone through three brand new project setups and get this error every time. Has anyone else faced this issue?

For context: I have an async function at the root of my project plugin code, even running
await new Promise(resolve => setTimeout(resolve, 1000)); will result in the error.

As far as I can tell the code will keep running, as long as it doesn’t rely on the asynchronous piece.

The error will only happen on the return from the await-ed funciton.

Please advise.

This topic has been closed for replies.

8 replies

Gleb
  • Power Member
  • 4716 replies
  • July 31, 2021

Do you have figma.closePlugin() in the end of code? Maybe it runs before the async function finishes if it’s outside?


Nikita_Jerschow

Just verified that close plugin is not called before the plugin exits, but that’s a good suggestion.

Do you know if it might be something else?


Gleb
  • Power Member
  • 4716 replies
  • July 31, 2021

Are you loading any fonts by any chance? figma.loadFontAsync is known for throwing this error, although I don’t remember why.


Lukas.B
  • 3 replies
  • January 23, 2022

@Nikita_Jerschow Did you solve this problem in the end?


Lukas.B
  • 3 replies
  • January 23, 2022

I had the same issue and solved it with “await”.
I called “figma.loadFontAsync” in an async function, but I didn’t add the “await” statement when calling that function. So adding the “await” solved the problem for me.


Simon43
  • 2 replies
  • November 6, 2022

Maybe just a problem with Figma runnig over a longer time?


S_e_b_a_s_t_i_a_n

Also think so. After restarting the desktop application, the error disappeared.


  • New Member
  • 4 replies
  • November 14, 2024

Thanks, it helped me too!