electron.js | ipcRenderer and ipcMain cause white / blank screen

I am creating a desktop app by using Electron, Vue + Vuetify but when I try to send something from rendererProcess to mainProcess with IPC, there becomes a white and blank screen, I do not know what caused this error.

// Main process

ipcMain.on('fileOps', (event, args) => {  }); 

// Renderer side

const ipcRenderer = require("electron").ipcRenderer  const buttonClicked = () => {      ipcRenderer.send("fileOps", "test"); } module.exports = buttonClicked   import buttonClicked from "../renderer/file.js";  export default {   mounted() {           buttonClicked();   }, 
Add Comment
1 Answer(s)

I solved the problem by setting nodeIntegration: true at main process.

Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.