Skip to main content
Question

Update codes in a plug-in file

  • February 21, 2023
  • 4 replies
  • 552 views

Jzzzoo

Hi everyone,

I followed the exact steps in this Figma tutorial to create a plugin on my own. I made changes to the “code.ts” file, but my plugin didn’t update the effects.

The details: I made changes to the “code.ts” file by replacing “Figma.createRectangle()” with “Figma.createEllipse()”. I relaunched the plugin on Figma, but the plugin still created rectangles rather than ellipses.

If I made the same change to the “code.js” file, I was able to update the plugin effects.

I have tried the following:

  • Restart my desktop, relaunch vs code, relaunch Figma
  • Ensure that I Install everything as required: vs code, node.js, npm, TypeScript, typings, (and verify all installation)
  • Select “Select Command Prompt” under “terminal select default profile”
  • Select “tsc:watch-tsconfig.json.”
This topic has been closed for replies.

4 replies

ntfromchicago

Just reporting that I’m having the same issue. I’m updating a plugin and the watch command isn’t doing the automatic updating of the .js file. I usually have to force a change to the config file or some other brute force hackery (e.g. force a tsc error loop on code.ts) to get the .js file to update.

This is more likely an issue with VS Code rather than Figma, but I’m checking here if anyone has seen a similar issue and figured out how to resolve it.


Philipp_Jeroma1

Same here. Did you find any solution for it?


  • Figmate
  • 2024 replies
  • June 14, 2024

Hi there, Thanks for reaching out about this!

While we are waiting for the input from our community, I will also reach out to our internal team that we have any information for this.

We are always open to hearing different ideas or perspectives from our community members on this matter. Please don’t hesitate to share your thoughts here.

Thanks again for reaching out.


dimadavidoff

Hi, when you update “code.tsx” it does not automatically update “code.js”, which is needed to run the plugin or widget. I assume you’ve followed the setup guide and created a build. To ensure “code.js” updates automatically when you make changes to “code.tsx” , you’ll need to run “npm run watch” in your project directory via your CLI.

Hope it helps 🤞


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings