Electronjs window.require not a function

前端 未结 3 1917
予麋鹿
予麋鹿 2020-12-21 04:51

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 desc

3条回答
  •  天命终不由人
    2020-12-21 05:34

    Indeed, you have to set nodeIntegration to true in your BrowserWindow webPreferences since the version 5.0.0 the default values of nodeIntegration and webviewTag are false to improve security. Electron associated PR: 16235

提交回复
热议问题