figma-export icon indicating copy to clipboard operation
figma-export copied to clipboard

Error: 'document' is missing.

Open maxsteenbergen opened this issue 1 year ago • 4 comments

Hi,

Somewhere in the last week, something on —as far as I can gather— Figma's side changed causing the package to fail with the error Error: 'document' is missing. It also does this on your example project, see screenshot:

Screenshot 2024-03-26 at 09 28 59

maxsteenbergen avatar Mar 26 '24 08:03 maxsteenbergen

Hi,

We're encountering the same problem, I've tried initially with version 4.7.0 and now with 5.1.0. I've tried debugging in the figma.js file and when i copy the yield client.file() function (with all parameters of course) to put it in a variable I can log to see what is happening, just before it is called initially (to set the document and styles properties) it works. So for some reason it looks like a timing issue?

Diaan avatar Mar 26 '24 14:03 Diaan

Ten hours later, I tried again and it all works as intended. So I assume @Diaan is on the right track with it being some timing issue or high workload on Figma's side. If there's anything I can do to monitor this, let me know.

maxsteenbergen avatar Mar 26 '24 19:03 maxsteenbergen

Hi @maxsteenbergen and @Diaan, I'm unable to reproduce this issue. Everything is working fine on my end, even with large files. Can you confirm the same? Is it working now?

The same issue happened in the past when Figma API started responding with 202 but with an empty body.

To get "monitored" about this in the future, they have this page https://status.figma.com but it looks like they didn't publish any incident yet.

They also have a community on Discord and someone mentioned the same issue yesterday.

One thing I can do on my end is to provide a more technical error message, maybe showing the simplest cURL you could run. If we get the same error message from interacting directly with Figma API we could promptly open an issue on their side with all the details.

marcomontalbano avatar Mar 27 '24 07:03 marcomontalbano

It seems to be working with the huge file we have as well this morning.

Diaan avatar Mar 27 '24 08:03 Diaan