Client on node: Uncaught ReferenceError: require is not defined

前端 未结 8 1488
遥遥无期
遥遥无期 2020-11-21 07:20

So, I am writing an application with the node/express + jade combo.

I have client.js, which is loaded on the client. In that file I have code that calls

8条回答
  •  春和景丽
    2020-11-21 08:06

    I confirm,

    We must add

    webPreferences: { nodeIntegration: true }

    for example: mainWindow = new BrowserWindow({webPreferences: { nodeIntegration: true }});

    For me, the problem has been resolved with that

提交回复
热议问题