Skip to main content
Nikita_Jerschow
Jul 30, 2021 7:27 PM UTC
Question

Uncaught (in promise) RuntimeError: function signature mismatch

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
Jul 31, 2021 12:11 AM UTC

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

Nikita_Jerschow
Jul 31, 2021 5:31 PM UTC

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
Jul 31, 2021 11:28 PM UTC

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

Lukas.B
Jan 23, 2022 12:33 PM UTC

@Nikita_Jerschow Did you solve this problem in the end?

Lukas.B
Jan 23, 2022 12:39 PM UTC

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
Nov 6, 2022 8:09 PM UTC

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

S_e_b_a_s_t_i_a_n
New Participant
Dec 22, 2023 1:01 PM UTC

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

New Member
Nov 14, 2024 7:05 PM UTC

Thanks, it helped me too!

Author of Variable Icons, a plugin for Figma