figplug icon indicating copy to clipboard operation
figplug copied to clipboard

Uncaught ReferenceError: process is not defined

Open iamtekeste opened this issue 5 years ago • 1 comments

I think this was supposed to be fixed on https://github.com/rsms/figplug/issues/2 but I can still reproduce the issue.

I ran this command with the latest figplug.

figplug -v init -react

Got the following output

write manifest.json
write plugin.ts
write figma.d.ts
write figplug.d.ts
write ui.html
write ui.tsx
write package.json
write tsconfig.json
npm install
added 12 packages from 28 contributors and audited 29 packages in 0.77s
found 0 vulnerabilities

I built it with the following command

figplug build -w

Got the following out put

building plugin "figma-video-player" at . -> build
built plugin "figma-video-player" at . -> build in 4.3s

But when I open up the plugin in Figma, I get the following error

Uncaught ReferenceError: process is not defined

iamtekeste avatar Feb 02 '20 03:02 iamtekeste

It does not work only in --watch mode Running figplug build without -w flag correctly executes following code, that replaces process.env.NODE_ENV with production

https://github.com/rsms/figplug/blob/master/src/pkgbuild.js#L355

Strajk avatar Aug 28 '21 21:08 Strajk