Skip to content

App window freezes at startup on Linux before content loads #4015

@abiddin

Description

@abiddin

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.

Forge version

7.9

Electron version

38.2

Operating system

Fedora 43

Last known working Forge version

No response

Expected behavior

I have a written an app using React and some other libs. Works fine on windows. Should work on Linux but doesn't.

Actual behavior

When I run the app on Linux (Fedora 43, GNOME) using 'npm start', the window opens up and freezes before the content loads (not even dev tools open). The OS then asks me if I want to force kill the app.

Steps to reproduce

Make sure that when creating the project using Electron Forge, there is a hyphen in the name (e.g. 'my-app'). This will set the productName to 'my-app' as well. Add React to the app with minimal content (I also had React Aria, TailwindCSS, Motion, and Lucide but I don't think they are the issue). Run 'npm start'. Your app window will freeze.

Note: While the window is frozen, if you visit 'http://localhost:5173/' in your browser, your react app works fine.

Workaround: After much troubleshooting, I have figured out that the issue is caused by productName property in package.json having a hypen in it. Setting productName to 'myapp' works fine. Interestingly, if you don't use react, the app works fine even if productName has hypen in it.

Additional information

I asked ChatGPT about the potential root cause for this, it gave the following answer:

productName in Electron Forge / Electron Builder is used to:

  • name your app’s executable and directories,
  • generate the AppImage / .desktop file / Linux app name,
  • and sometimes even the DBus application ID (which by Linux conventions must not contain hyphens unless properly escaped).

When productName includes a hyphen (-), Electron Forge’s packaging or DBus registration step may produce something like:

org.electron.quran-app

and that violates certain D-Bus or GLib naming rules (e.g., identifiers can’t contain - in some contexts).
As a result, on some Linux distributions (especially GNOME-based ones), the app can silently hang or crash on startup when initializing the native app menu or notifications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions