Skip to content

Zypak module error when running Flatpaks #2805

Open

Description

@BinetStudio

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

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.

Activity

  1. sarahstreza commented on Jun 14, 2022

    @sarahstreza

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

  2. koseduhemak commented on Jun 29, 2022

    @koseduhemak

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

  3. GabeDuarteM commented on May 19, 2024

    @GabeDuarteM

    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

  4. felipecrs commented on Aug 16, 2025

    @felipecrs

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

    This worked for me too!

  5. felipecrs commented on Aug 16, 2025

    @felipecrs

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

    This worked for me too!

    But I found a better workaround for it -- set packagerConfig.executableName to the same value as name in package.json. In my case:

    // forge.config.js
    
    /** @type {import("@electron-forge/shared-types").ForgeConfig} */
    const config = {
      packagerConfig: {
        // https://github.com/electron/forge/issues/2805#issuecomment-2119324715
        ...(process.platform === "Linux"
          ? { executableName: "clipboard-sync" }
          : {}),
        // ...
      }
    }

    This issue seems to have something to do with the Flatpak always trying to invoke the binary using name even though the binary is actually named after productName.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions