I'm using create-react-app (react-scripts v3.0.0) and electronjs (v5.0.1). I'm trying to pass events from the renderer to main process using the 'icpMain' module as described here, but get the error window.require
is not a function for the line
const { ipcRenderer } = window.require('electron');
How can I get require
into the global scope in the renderer process? Or is there another way of communicating between the main and renderer process?
Edit:
I've tried removing the react build entirely and get the same results simply using the electron example code in index.html.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…