12

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: [email protected] , but the errors still appear.

1 Answer 1

15

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()
  }
})
3
  • how can i enforce acceleration? to render smoothly?
    – Dan D.
    May 9, 2022 at 10:07
  • 3
    @Dee I think this can be done by setting the corresponding command line switch for Chromium with app.commandLine.appendSwitch('force_high_performance_gpu') as described here. May 11, 2022 at 21:17
  • Our app, containing a 3D rendered scene, needs HW acceleration which comes enabled by default in Electron so this isn't an option for us. While I would love not to see this error, I can't seem to find any effect on the app itself so our decision is to ignore it for now.
    – Damien
    Jun 21, 2022 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.