当前位置:网站首页>踩坑electron渲染进程renderer,解决require is not defined的问题
踩坑electron渲染进程renderer,解决require is not defined的问题
2022-07-23 05:47:00 【一路向呗】
踩坑electron渲染进程renderer,解决require is not defined的问题

解决办法
nodeIntegration: true
如果还不能解决加上
contextIsolation: false
完整代码
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
frame: false,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
nodeIntegration: true,
contextIsolation: false
}
})
win.loadFile('index.html')
}
边栏推荐
- Explain various network protocols in detail
- C#输出斐波那契数列
- Sword finger offer summary
- Learning diary - (routing and switching technology) single arm routing
- Unity3d: vector calculation, AOE graph intersection
- openvpn部署
- app编译打包部署手册
- OSPF 单区域配置实例学习记录
- Explain the release of TCP connection in detail
- Build FRPC client in NAS [super brainless]
猜你喜欢

默认路由配置实例学习记录

FTP实验及概述

Learning diary - (routing and switching technology) DHCP (Dynamic Host Configuration Protocol)

学习日记——(路由与交换技术)三层交换机

Simple use of psutil monitoring

DHCP second experiment

Hcip - first experiment

Telnet 配置实例学习记录

Understanding of LSM tree (log structured merge tree)

Learning diary - (routing and switching technology) ACL access control list
随机推荐
为什么要搭建本地yum仓库?
Gameframework: resource hot code analysis, check version information, download version files, verify version files, get the number of updated files, download files, taskpool
静态路由原理与配置
Real questions required for Niuke interview [algorithm] summary of high-frequency TOP200 questions
Hcip-hcia knowledge review (II)
Unity3d:ugui, UI and special effect particle level, bakemesh above 2018.2, particles between two images and in Scrollview
Integer times integer overflow
Routing and interface technology -- Summary of direct network
Hcip --- condition matching and OSPF Protocol
zabbix监控详细安装到部署
How far is the first kind of mistake from us
Hcip - HDLC and PPP protocols
Nas里搭建Frpc客户端【超级无脑】
Unity3d: script execution sequence on scene loading gameobejct
Liveness、Readiness 和 Startup Probes
Explanation of websocket protocol
Super easy to use packet capturing tool tcpdump
NFS service deployment notes
Explain the flow control mechanism and congestion control mechanism of TCP in detail
帧中继网配置实例学习记录