npx --yes create-figma-plugin
? Select a template: plugin/preact-rectangles
info Copying "plugin/preact-rectangles" template...
info Resolving package versions...
info Installing dependencies...
success Done
Then ran build:
npm run build
> build
> build-figma-plugin --typecheck
info Typechecking...
error TypeScript error
src/ui.tsx:31:6 - error TS2322: Type '{ children: Element[]; }' is not assignable to type 'IntrinsicAttributes & Omit<HTMLAttributes<HTMLDivElement>, keyof ContainerProps> & ContainerProps & Readonly<...>'.
Property 'space' is missing in type '{ children: Element[]; }' but required in type 'ContainerProps'.
31 <Container>
~~~~~~~~~
node_modules/@create-figma-plugin/ui/lib/layout/container/container.d.ts:5:5
5 space: ContainerSpace;
~~~~~
'space' is declared here.
Looks like the <Container> in ui.tsx needs a space prop, though it seems like there should be a default for that on every component.
This is likely because you’re running an outdated version of create-figma-plugin. The problem should go away if you run npx --yes create-figma-plugin@latest
I installed the template project:
Then ran build:
Looks like the
<Container>
inui.tsx
needs aspace
prop, though it seems like there should be a default for that on every component.