1.win8电脑上无法启动,点击图标后主进程报错:gpu process launch failed: error_code=xx
修复:
app.commandLine.appendSwitch('no-sandbox');
app.commandLine.appendSwitch('disable-gpu');
app.commandLine.appendSwitch('disable-software-rasterizer');
app.commandLine.appendSwitch('disable-gpu-compositing');
app.commandLine.appendSwitch('disable-gpu-rasterization');
app.commandLine.appendSwitch('disable-gpu-sandbox');
app.commandLine.appendSwitch('--no-sandbox');
app.disableHardwareAcceleration();
2.自动播放音频页面闪退
修复:
主进程中添加:
app.commandLine.appendSwitch('autoplay-policy', 'no-user-gesture-required');
依旧不行将
electron版本改为14.2.0,(多个版本都可以,此处只是修改成了原有版本最接近的版本)
相关问题:
3.electron从12升级到14后webview内node环境问题
由于Electron 12 版本之后 contextIsolation:将被默认true,
在主进程配置中设置contextIsolation:false后 webview中依旧用不了node环境
修复:
webview标签中添加属性:
webpreferences="contextIsolation=no"