Uncaught ReferenceError: process is not defined

发现许多博客只是添加了
nodeIntegration: true,
1
仍然会报这个问题


解决办法
# 再添加一行
contextIsolation: false
1
2
# 完整代码
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
// nodeIntegration: true
nodeIntegration: true,
contextIsolation: false
}
})

原文链接:https://blog.csdn.net/qq_41685731/article/details/115176424

相关文章:

  • 2021-09-16
  • 2021-06-16
  • 2021-05-28
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-23
  • 2021-05-14
  • 2021-04-21
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案