Search code examples
npmelectroncommand-promptchromiumnvidia

Win10 Electron Error: Passthrough is not supported, GL is disabled, ANGLE is


I have an electron repo (https://github.com/MartinBarker/RenderTune) which used to work on windows 10 fine when ran with command prompt. After a couple months I come back on a new fresh windows 10 machine with an Nvidia GPU, and the electron app prints an error in the window when starting up:

Uncaught TypeError: Cannot read properties of undefined (reading 'getCurrentWindow')

Running ffmpeg shell commands results in an error as well, and in the command prompt terminal this message is outputted:

[14880:1207/145651.085:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is disabled, ANGLE is

I checked on my other Windows laptop machines running the same exact code from the master branch of my repo, and it works perfectly fine when running locally.

It seems like this might be a recent issue? I have found it discussed in various forums: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1944468

https://www.reddit.com/r/electronjs/comments/qdauhu/passthrough_is_not_supported_gl_is_disabled_angle/

I tried upgrading my global electron npm package to a more recent version: electron@16.0.4 , but the errors still appear.


Solution

  • You can try disabling hardware acceleration using app.disableHardwareAcceleration() (See the docs). I don't think this is a fix though, it just makes the message go away for me.


    Example Usage

    main.js

    import { app, BrowserWindow } from 'electron'
    import isDev from 'electron-is-dev'
    
    app.disableHardwareAcceleration()
    
    let win = null
    
    async function createWindow() {
      win = new BrowserWindow({
        title: 'My Window'
      })
    
      const winURL = isDev
        ? 'http://localhost:9080'
        : `file://${__dirname}/index.html`
      win.loadURL(url)
    
      win.on('ready-to-show', async () => {
        win.show()
        win.maximize()
      })
    }
    
    app.whenReady().then(createWindow)
    
    app.on('window-all-closed', () => {
      win = null
      if (process.platform !== 'darwin') {
        app.quit()
      }
    })