I haven't used Electron but definitely your mistake should be around the main
file when setting it up, specifically in this line:
const appUrl = isDev
? 'http://localhost:3000'
: `file://${path.join(app.getAppPath(), 'out', 'index.html')}`;
Could you try setting it up like this guide? Hope it helps