RedMadRobot / figma-export

Command line utility to export colors, typography, icons and images from Figma to Xcode / Android Studio project
MIT License
719 stars 115 forks source link

Images not loading due to request timeout #57

Closed NoFearJoe closed 3 years ago

NoFearJoe commented 3 years ago

We have about 120 images and when we try to export them the request fails due to timeout. We tried to change the timeout in FigmaClient to 600, but got this error: Unexpectedly found nil while implicitly unwrapping an Optional value: file FigmaAPI/FigmaClient.swift, line 26.

We are using the latest version of figma-export (0.18.5).

subdan commented 3 years ago

I'll check it and get back to you tonight.

subdan commented 3 years ago

Try to change batchSize value from 100 to 20 in ImagesLoader.swift line 176.

DevFirts commented 3 years ago

Hello @subdan I change the batchSize to 20 but the problem remains. It looks like the call .map { try figmaClient.request($0) } is hanging in ImagesLoader#loadComponents

subdan commented 3 years ago

To fix this issue I need to reproduce it. I will create an example Figma file with 120 images and try to export it. I will do it by the end of the week and get back to you.

subdan commented 3 years ago

I've exported 242 image components (726 PNG images) using FigmaExport without any issues.

Possible issues:

  1. You have some complex images that Figma unable to exports and throws an error.
  2. You have big images for which Figma takes a long time to convert.

Could you show me the complex and the big one image you try to export? Which type of image do you try to export: raster or vector? What is the output format: PDF of PNG?

Possible solution:

  1. Try to export only 20 images. Is it succeed?
  2. Add another 20 images to your team library and try to export again.
  3. Repeat and find bad images.

If it is possible I can try to export your images if you give me access to your Figma File.

osipxd commented 3 years ago

Maybe this issue fixed with #60?

subdan commented 3 years ago

@osipxd Maybe.

I've just released 0.18.8 where I add timeout property to config file. See CONFIG.md for more info.

@NoFearJoe, @DevFirts Please, update FigmaExport, change timeout property to 60 or more and try to export images again.

DevFirts commented 3 years ago

I left only two images in the frame, but still when using FigmaExport an error occurs The request timed out. or Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value: file FigmaAPI/Client.swift, line 33 at the same time requests made via postman are processed quickly (~ 3 sec.)

We are using the latest version of figma-export (0.18.9). format: png timeout: 60 sec

subdan commented 3 years ago

Could you please give me access to your Figma file?

NoFearJoe commented 3 years ago

75

subdan commented 3 years ago

Fixed in 0.21.1 via #75