I have an electron-forge setup that I want to add electron-serve to.
I tried creating a /renderer
directory and putting an index.html in it and using this code
const loadURL = serve({ directory: "renderer" });
const createWindow = () => {
const mainWindow = new BrowserWindow({
width: 1600,
height: 800,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
},
});
// and load the index.html of the app.
// original electron-forge command
// mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY)
loadURL(mainWindow);
// Open the DevTools.
// mainWindow.websContents.openDevTools();
};
But I end up with
UnhandledPromiseRejectionWarning: Error: ERR_FILE_NOT_FOUND (-6) loading 'app://-/'
at rejectAndCleanup (electron/js2c/browser_init.js:217:1457)
at Object.failListener (electron/js2c/browser_init.js:217:1670)
at Object.emit (events.js:315:20)
Am I missing something simple?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too