When I use FormData to send a network request to pass a file, I encountered the following error. Can Figma support FormData in sandbox?
fetch API is ok to send file, but it need to change my previous file upload interface.
When I use FormData to send a network request to pass a file, I encountered the following error. Can Figma support FormData in sandbox?
fetch API is ok to send file, but it need to change my previous file upload interface.
I’m going to assume you’re attempting to fetch data in code.ts
. In this case, you’re trying to access browser APIs in a file that only knows about Figma APIs.
Try moving your logic to your UI file and then pass the response to code.ts
via a postMessage
.
Thanks you a lot. In dev mode codegen(recent supported by Figma) panel, sandbox can not communicate with ui.
When I called figma.showUI before, there was an error, thank you for your reply, I will try again.