When exporting nodes with exportAsync({ format: 'SVG' })
, the REST API sometimes generates <g filter="url(#id)">
references pointing to a <filter>
element that has no primitives. According to the SVG spec, applying such a filter causes the group to render nothing.
This means that shapes with simple fills/strokes (e.g. Polygon, Line, Vector) can appear correctly in Figma, but the exported SVG appears empty in strict renderers.
Steps to reproduce:
-
Create a polygon, vector or line.
-
Add a drop shadow effect.
-
Export via plugin using
node.exportAsync({ format: 'SVG' })
. -
Inspect the SVG: the node is wrapped in
<g filter="url(#filter0)">
but<filter id="filter0">
has no child primitives. -
Open the SVG in browser → shape is invisible.
Expected result:
If an effect cannot be represented in SVG, the exporter should omit the filter
attribute (or insert a trivial <feMerge><feMergeNode in="SourceGraphic"/></feMerge>
so the geometry is preserved).
Actual result:
An empty <filter>
is emitted, causing the element to disappear.
Impact:
-
Causes SVG exports from plugins to look blank in common viewers.
Request:
Please update the SVG exporter so that nodes with non-representable effects do not produce empty filter references, or at least provide an option in ExportSettingsSVG
to suppress these empty filters.