Search code examples
javascriptserverelectronelectron-packager

Blank screen when running Electron package app - How to debug?


I successfully packaged and ran an Electron project (desktop chat app) using the Electron Packager with no errors. However, I'm just getting a blank window on launch without the username form that was coded into the app. I'm not sure where to turn since there is no debug log. Can someone help me figure out how to debug the app and figure out why nothing is rendering?

The app in question is a product of this fine tutorial: https://medium.freecodecamp.org/build-a-desktop-chat-app-with-react-electron-and-chatkit-744d168e6f2f

I wish I could give more info...

enter image description here


Solution

  • Configure your main.ts properly and extend your BrowserWindow with the following code:

    win = new BrowserWindow({
        webPreferences: {
          devTools: true
        }
    });
    
    win.webContents.openDevTools();
    

    The chromium devTools should now appear on the side and you will be able to see occurring errors.