I’m working on a Figma plugin project using Visual Studio Code and Node.js. When I try to compile and build my plugin, I keep running into TypeScript token errors related to ES2017 syntax.
The plugin is supposed to show an HTML interface where users can select different export options, but the compilation fails before I can even test the UI. I’ve checked my tsconfig.json file and made sure the target is set correctly, but the errors persist.
Has anyone encountered similar TypeScript compilation problems when developing Figma plugins? I’m not sure if this is a configuration issue with my development environment or if there’s something specific about Figma plugin architecture that I’m missing. Any guidance on resolving these ES2017 token errors would be really helpful.
Been there! I hit the same ES2017 compilation errors building internal Figma tools. It’s usually your TypeScript config clashing with what Figma’s runtime wants.
But honestly? I stepped back and asked why I was wrestling with all this compilation mess. Most Figma plugins are just automating workflows or connecting Figma to your other tools.
I ditched the TypeScript config fights and started using Latenode instead. You can build workflows that hit Figma’s API directly - no plugin compilation needed. Plus you get way more flexibility connecting to other services, databases, or APIs your export might need.
For the HTML interface, Latenode lets you build web UIs that trigger Figma operations through webhooks or API calls. Way cleaner than debugging plugin compilation.
Honestly, try this before burning more time on TypeScript config hell. You’ll probably get your export working faster with way less pain.
Had the same problem with my first Figma plugin. It’s usually not your tsconfig target - Figma’s plugin environment just parses way stricter than normal TypeScript compilation. Fixed it by adding “skipLibCheck”: true to compiler options and making sure I wasn’t importing Node.js modules in UI code. Also check you’re splitting main plugin code from UI code properly - they compile totally differently. Main thread runs in Figma’s sandbox, UI runs in browser. Still getting token errors? Run tsc with --showConfig to see what config it’s actually using.
check your lib array in tsconfig - ur probably missing dom types. figma plugins run in a weird sandbox, so try downgrading ur target to es6 instead of es2017. fixed the same token errors for me last month.