Flatpak electron sample app

So, I wanted to learn how to create an electron application as Flatpak. Mainly because I wanted to create a Flatpak version of some of my favourite applications and possibly publish them on Flathub. I followed the instructions here LINK and tried to create Flatpak for electron-sample-app. Unfortunately, after 2 days of trying different solutions, reading docs, searching GitHub and GitLab I am lost.
I’m running Fedora 33.

What I did:

flatpak-builder build org.flathub.electron-sample-app.yml --install

Immediately after starting the build process, an error appears, but the process continues:

flatpak-builder:802504): Json-WARNING **: 12:38:01.204: Failed to deserialize "sources" property of type "gpointer" for an object of type "BuilderModule"

and at the end of NodeJS build process, flatpak-builder cannot install dependencies from generated-sources.json file.

To fix this, I run npm audit fix, generated a new generated-sources.json file and started the build process again. This time there were no errors, except:

error: Flatpak system operation ConfigureRemote not allowed for user
Install failed: Child process exited with code 1

So, I’ve installed once again, this time with --user option. Success.

The problem is, when I run flatpak, the main window appears, but without any content (only black screen). The Flatpak throws an error:

Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "pk-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
Gtk-Message: Failed to load module "pk-gtk-module"

The same thing happens when I’m using ‘Electron 2.0.18’ and org.electronjs.Electron2.BaseApp.

I was trying to use different runetimes and sdk’s(freedesktop 20.08) but due to lack of Python 2.7 support I was unable to build NodeJS below version 13. The build process of NodeJS 14 crashes here:

/run/build/nodejs/out/Release/obj.target/tools/v8_gypfiles/libv8_initializers.a -lm -ldl -Wl,--end-group
collect2: fatal error: ld terminated with signal 15 [Terminated]
compilation terminated.
make[1]: *** [cctest.target.mk:230: /run/build/nodejs/out/Release/cctest] Error 1
make[1]: *** Waiting for unfinished jobs.....

Is there any proper solution for building Flatpak electron app?

If you need python 2.7, build it first. There is a shared module for that.

Add the shared-modules submodule, and include the corresponding .json

Add shared-modules/python2.7/python-2.7.json to the modules in the manifest.

1 Like

Ok, I think I have found what I need here:


Perhaps it would be a good idea to update Flatpak Docs and the Electron Sample App.