electron-with-sqlite3
electron-with-sqlite3 copied to clipboard
Uncaught ReferenceError: require is not defined at main.html:5
The line const electron = require("electron");
in the client script is giving me the error
Verify if your BrowserWindow function has the webPreferences value, with a nodeIntegrations: true. It will resolve your problem with the error of require. See more here https://stackoverflow.com/questions/44391448/electron-require-is-not-defined
Try this as @LuC4SC4S said.
let mainWindow = new BrowserWindow({
height: 800,
width: 800,
show: false,
webPreferences: {
nodeIntegration: true,
},
});