nextron icon indicating copy to clipboard operation
nextron copied to clipboard

How to show a window from a page by use ipcRenderer?

Open letruonglamit opened this issue 2 years ago • 1 comments

When I implement, I got the errors like this: Screen Shot 2022-07-27 at 10 50 33

letruonglamit avatar Jul 27 '22 03:07 letruonglamit

If you comment line 29, does the error happen? It seem to come from elsewhere

Psycokwet avatar Jul 27 '22 07:07 Psycokwet

@letruonglamit I tried to recreate your error using the Material UI template but it works fine for me. Make sure nodeIntergration: true, contextIsolation: false, and if all that fails, try window.electron.ipcRenderer.send("sss").

roscoevanderboom avatar Oct 27 '22 11:10 roscoevanderboom

@letruonglamit, you should load it dynamically.

Something like this:

let ipcRenderer

if(typeof window !== "undefined" && window.process && window.process.type === "renderer"){
    ipcRenderer = window.require('electron').ipcRenderer
    console.log("DEBUG: ipcRenderer", ipcRenderer)
    ipcRenderer.send("sss")
}

bm777 avatar Dec 02 '23 00:12 bm777

Will close this issue :), feel free to reopen it if you have other issues.

bm777 avatar Dec 02 '23 00:12 bm777