yuanqing / figma-plugins

:fire: Monorepo for my Figma plugins
https://figma.com/@yuanqing
MIT License
239 stars 32 forks source link

Flatten Selection to Bitmap: Plugin quietly crashes if there is Component inside of the Selection #32

Closed davo closed 3 years ago

davo commented 3 years ago

I encountered this issue while working on a project with design work made by someone else. I was trying to raster a bunch of things and I noticed that Figma was crashing all the time when running the plugin.

After isolating the Frame that was causing the crash, I noticed that the designer who was working on the project before, left a Component placed inside of the design composition, maybe by accident.

Once I removed the component from the Frame I was able to get the Flatten Selection to Bitmap to run as expected.

Would it be possible to try to create a condition to prevent the plugin from crashing?

yuanqing commented 3 years ago

🤔 I suspect the plugin errors out because the Component you tried to flatten is part of a Library and so is read-only in the Figma plugin API. This would affect Component Sets also

yuanqing commented 3 years ago

Just shipped a fix (https://github.com/yuanqing/figma-plugins/commit/a4f4de65a6e933098b75f238115f00b644429993) and published a new version on Figma Community too

davo commented 3 years ago

Thanks @yuanqing!