添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
玩篮球的甘蔗  ·  Adobe Fireworks CS6 ...·  2 月前    · 
温柔的鸵鸟  ·  [2023-11-04 ...·  7 月前    · 
快乐的高山  ·  2.0.1版本try to re ...·  8 月前    · 

Greetings from a newbie!

I cannot get a call to Figma.getNodeByIdAsync() to work. Could anyone please tell me what I am doing wrong? I have searched this forum and referred to a sample plugin go-to that uses this function, but I am still stuck.

Below is my simplified code just for checking this functionality. When I run it as part of the plugin, console logs #1 and #2 are generated but not #3 , and the console returns to the ‘>’ prompt.

Thank you!

Thank you, @tank666 . I cleaned up the file so it contains only the below code. I added one console.log to be doubly sure. I still have the same issue: I get console logs #1 , #2 , #3 , but #4 is skipped. (I can get the demo plugin to work, though that does not have any async calls. I am trying to get the go-to plugin to work now.)

To make it work you need to run it async way. Just wrap your code into another asynchronous function and run getParent with await keyword

(async ()=> {
    await getParen(id);
    figma.closePlugin();
              

Thank you, @Pavel_Kiselev . I tried this and added some null checks with a renamed function that does the same thing. However, still no luck, I get only console logs #1, #2, #3 but not #4. What else could be the reason?