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 run-launcher 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. The google-cloud stuff is in a file that must be imported. I wonder if the flatpak command changes between ‘production’ to ‘development’ when the app is run in a terminal. (?)

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.

This is the url to the project. I apologize for the messy state of the repository.

1 Like

Is there a way, with the finishing arguments, to load the contents of a file like ‘.bashrc’ ?? I can get my flatpak program to load, but I need to modify the Exec line of the launcher to something like this:

    x-terminal-emulator -e bash -i -c "flatpak run my.package.Name" 

I know that flatpak does not want to have an Exec line like this.

I have an environment variable that I must set in order to run my google-cloud speech recognition. I think Docker has provisions for this sort of thing, so I’m wondering about flatpak.