the-dataface / figma-plugin-svelte-vite

Build a Figma plugin using Svelte + Vite + TypeScript
MIT License
11 stars 0 forks source link

Error with libraries like chroma-js #13

Open gigig987 opened 4 months ago

gigig987 commented 4 months ago

Hi, thanks for this repository is a great starting point for any plugin. I'm recently struggling to import a library like chroma-js. Vite bundle everything correctly and the build works. But when I launch the plugin I have an error triggered by vendor-core: syntax error on line 247: Unexpected token { } catch { ^

removing the library from the dependencies makes the code working again.

sawyerclick commented 4 months ago

@gigig987 Glad you're making use of the template! I installed chroma-js and used it just fine on the plugin and UI side of the application.

Could you provide more details as to the error or, more preferably, a repo I could look at?

gigig987 commented 3 months ago

Thanks @sawyerclick , I created a repo for you to have a look at. colors.ts is the file where I'm trying to import chroma-js. The package is not yet installed at this stage, and the plugin runs in Figma normally. If I try to install and import the package the plugin doesn't even start. In any case the plugin builds just fine. The error happens at runtime to me