marcomontalbano / figma-export

Export tool for Figma. You can easily and automatically export your Figma components and use them directly into your website.
https://figma-export.marcomontalbano.com
MIT License
256 stars 33 forks source link

Error: 'document' is missing. #166

Open maxsteenbergen opened 5 months ago

maxsteenbergen commented 5 months ago

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
Diaan commented 5 months ago

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?

maxsteenbergen commented 5 months ago

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.

marcomontalbano commented 5 months ago

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.

Diaan commented 5 months ago

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