Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 283
pfbarnet Avatar asked Nov 24 '25 08:11

pfbarnet


1 Answers

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.

like image 106
NeatFeature Avatar answered Nov 26 '25 22:11

NeatFeature



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!