Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4k
Description
I am using this approach for creating and exe for my react app, since the app is pretty big, but when I run the react server and run this commandnpx electron
it's working just fine, but when I build the entire app using electron-builder, it creates the build files and .exe for me, but when I try to open the .exe file the UI does'nt render.
I did the same steps for a brand new react app which is working just fine, but with my primary react app the exe is not rendering the UI.
I can only see the CSS get loaded, because the main window bg color is the one I used in my app.
this is the main.js file I am using
`const { app, BrowserWindow } = require("electron");
const fs = require("fs");
const path = require("path");
let win;
app.whenReady().then(() => {
win = new BrowserWindow({
height: 800,
width: 1000,
});
if (app.isPackaged) {
win.loadFile("./gui/build/index.html");
} else {
win.loadURL("http://localhost:3000");
}
});
process.on("uncaughtException", (err) => {
const logPath = path.join(__dirname, "error.log");
fs.appendFileSync(logPath,${new Date()}: ${err.stack}\n
);
});
`
Looking forward for your assist. Thanks