'parts of npm/electron package do not work unless launched from a terminal

I'm using electron 17.1.2 and packaging it in a flatpak. When I run the app (the flatpak) from the runlauncher on my system, some of the functionality is lost. Things that are meant to happen in the main thread (the thread where the menus are located) don't work.

Strangely the menus themselves work, but I run some speech-to-text functionality and that is not working. That uses google-cloud.

If I run the package from the command line ('flatpak run my.package.Name') everything works. Additionally, every time I run the app from npm ('npm run start') everything works.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source