Skip to main content
Question

Unable to use figma.ui.reposition()


Alex_FG

My typings file is updated to 1.58.0 but I’m still getting

error TS2339: Property ‘reposition’ does not exist on type ‘UIAPI’.

during compilation, but at run time everything seems to work. 🤷

Is there something else I need to update?

This topic has been closed for replies.

10 replies

tank666
  • 4873 replies
  • February 10, 2023

Perhaps your compiler is referring to some other (old) typing file.


Alex_FG
  • Author
  • New Participant
  • 32 replies
  • February 10, 2023

Is there something else I can update that would could fix this?


tank666
  • 4873 replies
  • February 10, 2023

I don’t know what you are using, so my answer will be general: change or provide a new path to the typing files in your IDE.


Alex_FG
  • Author
  • New Participant
  • 32 replies
  • February 10, 2023

Oh I’m sorry, I’m using VS Code with a standard installation as per the intro tutorial (might be an older tutorial because now there’s something about an installer and I think I remember having to type a bit more).


Alex_FG
  • Author
  • New Participant
  • 32 replies
  • February 10, 2023

Is figma.ui.reposition() new? I know I’ve been waiting for it for a long time, but I don’t remember seeing it in the docs until I saw it last night by accident. Maybe it’s not properly exposed or something? I’ve updated the typings and did everything I could google to solve this. It still says that it doesn’t find .reposition()


JosephxBrick
  • New Participant
  • 67 replies
  • February 10, 2023

It’s odd because when you go to the github repository, the file does contain the reposition function:

image

…but the file in v1.58.0 (under “tags” in the repository) doesn’t have it.

I modified the file locally, and the IDE stopped complaining about it and there were no console errors when run, but it didn’t work reliably - e.g., it only repositioned the window occasionally, whereas the “resize” function used in the same spot worked every time.


Gleb
  • Power Member
  • 4708 replies
  • February 11, 2023

Yes, it is very new, it is not officially released yet.


Alex_FG
  • Author
  • New Participant
  • 32 replies
  • February 11, 2023

Is there an ETA by any chance, since the API has already been published?


Gleb
  • Power Member
  • 4708 replies
  • February 11, 2023

Figma doesn’t disclose their plans usually. But in my experience it should be released this month since it was already added to typings.


Alex_FG
  • Author
  • New Participant
  • 32 replies
  • February 11, 2023

So excited for this function! 🤩


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings