Unable to use figma.ui.reposition()

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. :man_shrugging:

Is there something else I need to update?

1 Like

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

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

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.

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).

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()

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.

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

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

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

So excited for this function! :star_struck: