SVG gradient breaks when importing into Figma

I wrote a program to create an SVG which I can then paste into Figma to add text and other features to. However, when I paste the svg, the gradient-fill extends well beyond the svg so it appears only one color.

Any ideas how to fix this? I can supply my javascript program if you would like, but it is pretty long.
Any help would be appreciated.

1 Like