Skip to main content
Solved

Import NPM packages into index.ts file

  • February 21, 2022
  • 4 replies
  • 2069 views

Steven_Limcorn

I am trying to create a Figma plugin that requires a scarping tool called Puppeteer. I tried installing the library and using it in the index.ts file by simply using const puppeteer = require(‘puppeteer’) but it doesn’t work. Is it possible for me to use puppeteer with figma plugins?

Best answer by Gleb

This is a Node (server-side) library, you cannot use it on the client side (in the browser).

View original

4 replies

Gleb
  • Power Member
  • 4706 replies
  • Answer
  • February 23, 2022

This is a Node (server-side) library, you cannot use it on the client side (in the browser).


Steven_Limcorn

Thanks for your reply, but I thought only the widgets are client-side?


Gleb
  • Power Member
  • 4706 replies
  • February 23, 2022

Everything that is on your computer is client-side (computer/browser/Figma/plugin/widget is a client). (This is a simplification but accurate in this context.)


Steven_Limcorn

Cool thanks for the help 😃


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