Closed broisnischal closed 7 months ago
I'm receiving the same error while running yarn run watch
and also when I try to build the project yarn build
"@create-figma-plugin/ui@^3.1.0"
@broisnischal just in case I end up skipping the lib check to avoid this error, in tsconfig.json
adding skipLibCheck: true
"compilerOptions": {
...
"skipLibCheck": true
},
...
}
Getting the same error ... here to find a workaround!
Sorry for the delay folks! Life got a bit crazy so didn’t get the chance to properly look into this. The fix should be included in the next release (v3.2.0
)
This issue should be fixed as of 3.2.0
$ npx --yes -- create-figma-plugin@3.2.0 --template plugin/preact-rectangles
info Copying "plugin/preact-rectangles" template...
info Resolving package versions...
info Installing dependencies...
success Done
First:
cd preact-rectangles
To build the plugin:
npm run build
To watch for code changes and rebuild the plugin automatically:
npm run watch
$ cd preact-rectangles
$ npm run build
> build
> build-figma-plugin --typecheck --minify
info Typechecking...
success Typechecked in 0.850s
info Building...
success Built in 0.327s
I just updated it, and everything is working perfectly! Thanks @yuanqing
Note for others: give it a try by deleting all node_modules and building from scratch, because I did the update and I was still seeing the error, but once I did the complete flush, everything works perfect
-- // type First<T extends never[]> = T[0];
++++ type First<T extends any[]> = T extends [infer F, ...any[]] ? F : never;
type FirstArgument<EventHandler extends ((...args: any) => any) | undefined> = EventHandler extends undefined ? never : First<Parameters<NonNullable>>;
node_modules>@create-figma-plugin>ui>lib>types>event-handler.d.ts