Skip to main content
Question

Uncaught Error in widget

  • October 20, 2022
  • 2 replies
  • 614 views

Edmund_Gauci

I am working on a widget and it appears to work correctly, but in the console I get this: Uncaught Error: “Expected rectangle fill network when generating indiv borders network” in generateFillableStrokeNetworkFromFillNetwork (FGNodeHelpers.cpp)

This is the only indication that something is wrong, because in both desktop app and Chrome, it functions as expected.

I can’t figure out the issue. If I step through the code, the error happens during the render.

Here is the render code in case it helps. I’d appreciate any insight because I’ve stared at this and I can’t spot the issue. I can provide the rest of the code if necessary

const { widget } = figma
const { useSyncedState, AutoLayout, Text } = widget

function Widget() {

  // code removed for clarity. The issue seems to happen during render

  return (
    <AutoLayout
      direction={'horizontal'}
      verticalAlignItems={'center'}
      horizontalAlignItems={'center'}
      width={170}
      spacing={8}
      padding={16}
      cornerRadius={8}
      fill={'#FFFFFF'}
      stroke={'#333333'}
      onClick={handleClick}
      tooltip={'Click to toggle flag visibility'}
    >
      <Text fontSize={26}>{flagsVisible ? 'Hide' : 'Show'}</Text>
      <Text fontSize={26}>flags</Text>
    </AutoLayout>
  )
}

widget.register(Widget)

2 replies

Gleb
  • Power Member
  • 4706 replies
  • October 20, 2022

This error comes from the Figma’s rendering engine, not from the plugin/widget API. It doesn’t mean that something is wrong with your code. Just an internal issue.


Edmund_Gauci

Thank you for your reply. I’ll stop worrying about it.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings