yagudaev / figma-to-json

💾 Read/Write Figma Files as JSON
https://figma2json.com
MIT License
199 stars 27 forks source link

JSON re-upload + export to .fig gives invalid .fig file #22

Open coscotuff opened 6 months ago

coscotuff commented 6 months ago

ISSUE:

When I re-upload a JSON file that I previously exported from the application, and then export it as a .fig file, then at the time of uploading the .fig file to Figma, I get an "Internal error during import" error.

REPRODUCING THE ERROR:

1) Export a .fig file from Figma, any template with some sort of a text box should do (I have only tried it out with a text box). 2) Upload the .fig file to the web interface (i.e., on https://www.figma2json.com/). 3) Export the corresponding JSON file. 4) Re-Upload the JSON file to the web interface and this time, export as a .fig file. 5) Upload the newly exported .fig to Figma.

ERROR:

The error that comes up on uploading this .fig file to Figma is "Internal error during import", as can be seen below: image

INVESTIGATING DIFFS:

In order to understand where things may be going wrong, I also exported the corresponding .fig file and JSON file in the 3rd and 4th steps respectively. These are named OLD. (3rd step) and NEW. (4th step).

1) When uploading the figma file exported in the 3rd step to Figma, no error comes up, as can be seen below: image

2) Next, when passed through a diff checker, both the old and new JSON files have 0 difference (which is expected as there shouldn't be any difference anyway). image

3) Finally, I passed the old and new .fig files through a diff checker and found that there are ~30 lines extra in the original .fig file (which was made into a text file first to copy its contents) at the end of the file. image

So, how do I resolve this issue? Or what may I be doing wrong?

Jai310502 commented 6 months ago

I am also facing the same issue.

MistaahJ commented 6 months ago

Hey, I am facing a similar issue. Basically followed the same steps as mentioned in the error reproduction section. The only difference being I also edited the textbox value in the json before exporting it in step 3. Not sure how to proceed, would be great if someone suggests a fix 😄