当前位置:网站首页>Electron使用romote报错 : Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
Electron使用romote报错 : Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
2022-07-30 05:50:00 【HW-Header】
今天在学习electron当中的remote模块时,遇到了一个巨坑:remote模块不存在。在国内的问答网站中皆未找到解决办法,最后在stack overflow中找到了解决办法,在此留下足迹,帮助其他伙伴。
原因很简单,在Electron 10.x中,enableRemoteModule的默认值为false,也就是默认情况下是不支持使用remote模块的,因此使用remote模块的应用程序需要将enableRemoteModule显式设置为true。
mainWindow = new BrowserWindow({
width:400,
height:400,
webPreferences: {
nodeIntegration: true, // 集成node环境
enableRemoteModule: true // 使用remote模块
}
}) //设置打开的窗口大小
边栏推荐
- Install MySQL under Linux (centos7)
- Boot process and service control
- 你被MySQL 中的反斜杠 \\坑过吗?
- Redis下载与安装
- 新人误删数据,组长巧用MySQL主从复制延迟挽回损失
- VR机器人教你如何正确打乒乓球
- Software Testing Terminology - Scenario Testing
- Linx common directory & file management commands & VI editor usage introduction
- 预测人们对你的第一印象,“AI颜狗”的诞生
- Test Development Engineer Growth Diary 015 - Top 20 Test Interview Questions
猜你喜欢

@Bean 与 @Component 用在同一个类上,会怎样?

Redis 如何实现防止超卖和库存扣减操作?

Detailed explanation of numpy multidimensional array ndarray

The calculation and source code of the straight line intersecting the space plane

LVM和磁盘配额

MySql connecting to the server remotely

prometheus-basic_auth加密配置

C#的访问修饰符,声明修饰符,关键字有哪些?扫盲篇

相机坐标系,世界坐标系,像素坐标系三者转换,以及OPENGLDEFocal Length和Opengl 的 Fov转换

numpy 多维数组ndarray的详解
随机推荐
idea内置翻译插件
Equation Derivation Proof of Vector Triple Product
相机坐标系,世界坐标系,像素坐标系三者转换,以及OPENGLDEFocal Length和Opengl 的 Fov转换
roslyn folder under bin folder
Station B collapsed, what would you do if you were the developer in charge that night?
MongoDB - query
预测人们对你的第一印象,“AI颜狗”的诞生
Table with tens of millions of data, how to query the fastest?
Test Development Engineer Growth Diary 003 - Interface Automation Framework Construction
The calculation and source code of the straight line intersecting the space plane
手机端滚动至页面指定位置
向量三重积的等式推导证明
Multithreading basics (multithreaded memory, security, communication, thread pools and blocking queues)
Process and Scheduled Task Management
计算矩阵的逆源码(使用伴随矩阵,3×3的矩阵)
schur completement
Network Protocol 01 - Basic Concepts
Multithreading basics (concept, create, interrupt)
The introduction of AI meta-learning into neuroscience, the medical effect is expected to improve accurately
Distance calculation from space vertex to straight line and its source code