Figma-Linux/figma-linux

React, Webpack based figma plugin code doesn't run after version 0.11.0 onwards

satenshakya opened this issue · 7 comments

  • App version: 0.11.0+

  • Type of installed package (Snap, AppImage, deb, rpm, pacman): deb

Bug description
I have used React and Webpack to develop the Figma plugin UI. It worked fine with version 0.10.0 but after the 0.11.0 update, the plugin did not run.

Getting the following error:
Promise (id: "17") reject via error: in figma plugin

@satenshakya could you run the app from terminal and pin the output after the plugin crash?

@satenshakya Or can you provide a plugin sample which triggers this bug?

I have the same issue.

You can recreate it by creating a new plugin. Move code.js to a subfolder like dist. Update manifest.json to "main": "dist/code.js". Then try to import the plugin.

Something about the code is a subfolder causes the error.

Here is the sample manifest.json
{ "name": "test", "id": "1327027891131770454", "api": "1.0.0", "main": "dist/code.js", "capabilities": [], "enableProposedApi": false, "editorType": [ "figma" ], "networkAccess": { "allowedDomains": [ "none" ] } }

Same Error with our @streamlinehq plugin.

Screencast.from.2024-01-11.07-53-34.webm

This is the error log when running figma from flatpak console. @ChugunovRoman

Error occurred in handler for 'createMultipleNewLocalFileExtensions': Error: Filename "dist/figma.js" not allowed
    at _hasFigmaSession.validateFileName (/app/figma-linux/resources/app.asar/main/main.js:1:69749)
    at _hasFigmaSession.validateExtensionFiles (/app/figma-linux/resources/app.asar/main/main.js:1:70165)
    at _hasFigmaSession.addExtension (/app/figma-linux/resources/app.asar/main/main.js:1:68724)
    at o (/app/figma-linux/resources/app.asar/main/main.js:1:71564)
    at async Promise.all (index 0)
    at async _hasFigmaSession.createMultipleNewLocalFileExtensions (/app/figma-linux/resources/app.asar/main/main.js:1:71651)
    at async WebContents.<anonymous> (node:electron/js2c/browser_init:2:88640)

Same here. Manjaro, AUR package, v0.11.2, can't import Vue 2 app built with Webpack. Before the update everything was ok. It also works when manifest is in the same directory as plugin's files (code.js, app.html, etc)

Error occurred in handler for 'createMultipleNewLocalFileExtensions': Error: Filename "dist/code.js" not allowed
    at _hasFigmaSession.validateFileName (/opt/figma-linux/resources/app.asar/main/main.js:1:69749)
    at _hasFigmaSession.validateExtensionFiles (/opt/figma-linux/resources/app.asar/main/main.js:1:70165)
    at _hasFigmaSession.addExtension (/opt/figma-linux/resources/app.asar/main/main.js:1:68724)
    at o (/opt/figma-linux/resources/app.asar/main/main.js:1:71564)
    at async Promise.all (index 0)
    at async _hasFigmaSession.createMultipleNewLocalFileExtensions (/opt/figma-linux/resources/app.asar/main/main.js:1:71651)
    at async WebContents.<anonymous> (node:electron/js2c/browser_init:2:88640)

TestLinuxFigma.zip
Screenshot from 2024-01-15 19-47-07
Here is the sample project and error screenshot I'm getting in figma-linux app.
@ChugunovRoman

@satenshakya the "main" property should "src/code.js", but the plugin will not imports. I fixed that