electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.49k stars 519 forks source link

Zypak module error when running Flatpaks #2805

Open BinetStudio opened 2 years ago

BinetStudio commented 2 years ago

Pre-flight checklist

Electron Forge version

6.0.0-beta.63

Electron version

v18.0.4

Operating system

Fedora 35

Last known working Electron Forge version

No response

Expected behavior

I use electron-forge to build the default template Hello world app flatpak. The build process goes fine, installation of the flatpak goes fine. Running the flatpak should too.

Actual behavior

I run this command

flatpak run io.atom.electron.test1 

I get this error

[13 zypak-sandbox] Failed to send spawn request to supervisor: Bad file descriptor (errno 9)
/app/bin/electron-wrapper: line 3:     3 Trace/breakpoint trap   (core dumped) zypak-wrapper "test1" "$@"

Steps to reproduce

Place this into your packages.json file under makers

{
    "name": "@electron-forge/maker-flatpak",
    "config": {
    "files": []
}}

run

npm run make

then go to the out/make/flatpak... directory and install the flatpak using

flatpak install --user io.atom...

Then run the installed flatpak

Additional information

I found a potential fix by setting the zypak module manually as shown here

        {
          "name": "@electron-forge/maker-flatpak",
          "config": {
            "options": {
              "categories": [
                "Utility"
              ],
              "icon": {
                "512x512": "icon.png"
              }
            },
            "modules": [
              {
                "name": "zypak",
                "sources": [
                  {
                    "type": "git",
                    "url": "https://github.com/refi64/zypak",
                    "tag": "v2022.03"
                  }
                ]
              }
            ]
          }
        }

If this is a known issue it should be documented properly.

stevestreza commented 2 years ago

I ran into this issue on Arch Linux, the fix noted solved the issue for me.

koseduhemak commented 2 years ago

Same problem here on Pop OS. Mentioned fix works for me as well.

GabeDuarteM commented 6 months ago

I had this as well, but the potential fix mentioned didn't work.

What worked for me was to remove the productName field from the package.json, not sure why