Skip to main content
Question

Figma doesn't see external JS file


Anna Malinina

Hello!
I’m trying to create plugin for Figma. I use React + ESbuilder. I have src and dist folders.

 

My index.html contains:

<div id="root"></div>
<script src="ui.js"></script>

The problem is that plugin doesn’t see (or what?) ui.js. When I start plugin I see only empty screen.

If I write JS code exactly in script tag — it works. But with external file it doesn’t work. 

There are no errors anywhere.

What should I do to solve this?

4 replies

Rafitheartsy

I’m also having the same problem, my external ui.js is not sync with ui.html.


Anna Malinina
Rafitheartsy wrote:

I’m also having the same problem, my external ui.js is not sync with ui.html.

I found one solution — to use inline JS code.


Rafitheartsy

I’m using a few assets (images) in my plugin. Everything works perfectly in Chrome when using ui.css and ui.js, but in Figma, the assets, styles, and scripts are not syncing properly.


James Simonson

I was under the impression that you can only have one TS/JS file and if you want to split it up you need to use something like web pack to merge them together. 


Reply


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