-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Empty SVGs #117
Handle Empty SVGs #117
Conversation
Hi @amcolash, thanks a lot for your contribution! I think that handling this issue on this side is fine while waiting for an answer from Figma. Just realized that I'll move the release process in a different file, and update the |
No worries at all, I have reverted the versions. Upon further investigation today, I have found that the API is not "technically" broken. There was an empty frame and the API correctly returned an empty file. From my work on my exporting project, it has been an ongoing issue. Some versions of this file just have empty frames, which might be part of my team's design process. I asked support if their engineers would consider changing the API to instead return an empty svg file.
Of the three options, I prefer 2 since everything is exported as expected. The empty svg files are harmless in my opinion and are reflective of the state of the component at that point. We could add in a warning message, so at least it is logged that the component is empty during the export. Here is an idea of how option 2 could look.
OR a slightly more verbose option:
Thoughts? |
2a1274a
to
8a3098d
Compare
Quick update: Got a response from figma support - it sounds like this may be intended behavior, so I think handling it in the export is probably the best option for now. |
Hi @amcolash, thanks for this analysis. I'm going to accept this PR and bundle with the next release! Thanks! |
Awesome, thanks so much! Appreciate the help and happy to contribute to this great project 😁 |
I have been having an issue where the Figma API is returning empty SVG files. I am not sure if this is a common problem or if there is a known solution. Either way, I submitted a ticket to Figma support for help on the issue.
In the meantime, I think that handling the invalid file earlier rather than later gives a much better debugging experience instead of having the parsing of the empty SVG file happen later on.
This PR handles such a case more gracefully.
This is my first time submitting code to this repo - not sure if each change is a separate version or if you bundle your changes together. Happy to do anything else needed! Thanks :)