Blank page when app started / no content #943

Closed
opened 2026-01-29 16:52:27 +00:00 by claunia · 1 comment
Owner

Originally created by @nazar322 on GitHub (Apr 17, 2024).

  • Version: 23.6.2
  • Target: win-x64, osx

In the built application sometimes the content is not loaded and therefore there is a blank space in the client area.
I have attached the screenshot.
Having googled the issue I see many have the same problem with just an electron and the typical solution would be changing the parameter in win.loadURL. F.i. https://stackoverflow.com/a/52497939/501082 or https://at15r.medium.com/electron-app-showing-white-screen-after-successful-build-but-work-in-development-mode-7e4f612a0871

I am able to reproduce this case on my Windows VM instance quite often, almost always, but rarely in osx or my host Windows computer.

I looked at main.js for the Host project and the only occurrence of loadURL is for the splash screen. The splash screen shows fine, however then the main window produces no content.

I'm really sweating bullets with this issue.
Does anyone have encountered it or perhaps has some ideas on the issue?

In OSX, I can press the red X button and then restore the app from the background, and the UI is loaded, but on Windows minimizing/restoring from the taskbar does not do anything.

VirtualBox_Windows 10 (64-bit) Home edition_17_04_2024_15_02_14

Originally created by @nazar322 on GitHub (Apr 17, 2024). <!-- Please search existing issues to avoid creating duplicates. --> <!-- Which version of Electron.NET CLI and API are you using? --> <!-- Please always try to use latest version before report. --> * **Version**: 23.6.2 <!-- Which version of .NET Core and Node.js are you using (if applicable)? --> <!-- What target are you building for? --> * **Target**: win-x64, osx <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> In the built application sometimes the content is not loaded and therefore there is a blank space in the client area. I have attached the screenshot. Having googled the issue I see many have the same problem with just an electron and the typical solution would be changing the parameter in `win.loadURL`. F.i. https://stackoverflow.com/a/52497939/501082 or https://at15r.medium.com/electron-app-showing-white-screen-after-successful-build-but-work-in-development-mode-7e4f612a0871 I am able to reproduce this case on my Windows VM instance quite often, almost always, but rarely in osx or my host Windows computer. I looked at `main.js` for the Host project and the only occurrence of `loadURL` is for the splash screen. The splash screen shows fine, however then the main window produces no content. I'm really sweating bullets with this issue. Does anyone have encountered it or perhaps has some ideas on the issue? In OSX, I can press the red X button and then restore the app from the background, and the UI is loaded, but on Windows minimizing/restoring from the taskbar does not do anything. ![VirtualBox_Windows 10 (64-bit) Home edition_17_04_2024_15_02_14](https://github.com/ElectronNET/Electron.NET/assets/10635299/dc6beab2-95aa-4d1b-9bf8-1331ae80521f)
claunia added the bug label 2026-01-29 16:52:27 +00:00
Author
Owner

@nazar322 commented on GitHub (Apr 23, 2024):

Here is the fix!

mainWindow.OnShow += OnMainWindowShown;
mainWindow.OnClosed += OnMainWindowClosed;

private static void OnMainWindowShown()
{
    if (!_windowShownFlag)
        ElectronHelper.MainWindow.Reload();

    _windowShownFlag = true;
}

private static void OnMainWindowClosed()
{
    _windowShownFlag = false;
}
@nazar322 commented on GitHub (Apr 23, 2024): Here is the fix! ``` mainWindow.OnShow += OnMainWindowShown; mainWindow.OnClosed += OnMainWindowClosed; private static void OnMainWindowShown() { if (!_windowShownFlag) ElectronHelper.MainWindow.Reload(); _windowShownFlag = true; } private static void OnMainWindowClosed() { _windowShownFlag = false; } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#943