How are you compiling your plugin? What are you using to build it?
I created the plugin in a figma desktop app. I opened it in Visual studio code. I installed latest typescript. A default figma plugin project contains a Readme file to do the steps. I did all.
npm install --save-dev @figma/plugin-typings
I used terminal ->Run build task - tsc watch tsconfig.json option.
Ok, I think I see what is happening. You are issuing an export interface, which is the only export in this module. Typescript therefore converts it to export {} inside of the final .js file.
But that doesn’t work in the browser.
So you just need to remove that export keyword and just use the interface.
In other words, you should avoid having exports in the entry file. I’d create additional files.
figma_app.min.js.br:5 Syntax error on line 7: Unexpected identifier
interface ExportableBytes {
figma_app.min.js.br:5 Error: Syntax error on line 7: Unexpected identifier
at vEs (figma_app.min.js.br:1467:95)
at async figma_app.min.js.br:1464:6435
This was used in my typescript, code.ts
I moved it to figma.d.ts. That error gone but started complaining another line.
figma_app.min.js.br:5 Syntax error on line 9: Unexpected token :
async function main(nodes): Promise {
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.