Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
satenshakya opened this issue Dec 20, 2023 · 7 comments

Comments

@satenshakya
Copy link

  • 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

@ChugunovRoman
Copy link
Collaborator

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

@ChugunovRoman
Copy link
Collaborator

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

@spfoos
Copy link

spfoos commented Jan 10, 2024

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" ] } }

@andirsun
Copy link

andirsun commented Jan 11, 2024

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)

@Archangel603
Copy link

Archangel603 commented Jan 15, 2024

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)

@satenshakya
Copy link
Author

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

@ChugunovRoman
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants