figma-plugin-helper-functions / figma-plugin-helpers

A collection of useful helper functions to import to your Figma plugin project
261 stars 25 forks source link

Circular dependency problem #79

Open gavinmcfarland opened 3 years ago

gavinmcfarland commented 3 years ago

I'm getting an error when using the clone() helper. I believe it's because of a circular dependency problem, but that's just a hunch.

When I run clone(figma.createFrame()) I now get the following error:

RangeError: Maximum call stack size exceeded
<ref *1> LayoutMixinStub {
      type: 'FRAME',
      children: [],
      parent: ChildrenMixinStub {
        type: 'PAGE',
        children: [ [Circular *1] ],
        parent: ChildrenMixinStub { type: 'DOCUMENT', children: [Array] }
      }
    } []

Could it by trying to loop through the parent, which then loops through the children and then through the parent again?