Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Electron fix "ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command"

Tags:

electron

I recently stepped down my electron application removed knex and sqlite since it was painfully complicated to creating a rebuild on windows also when i made an executable for windows sqlite database didn't seem to work. Linux executable worked fine with sqlite guessing the same with mac.

To use sqlite i had rebuilt the application using electron-rebuild. In order to clear the rebuild i did rm -rf node_modules && npm install

I have eventually decided to use IndexDB using dexie.

However now when i try to run my program from npm i get

ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

How do i fix this, why is it happening ?

NB: The application works just fine but this error i the terminal is just annoying and i have no idea why its happenning

like image 285
xaander1 Avatar asked Oct 11 '19 20:10

xaander1


2 Answers

Do a test,

electron /path/to/the/app [You will get that Error]

Try

electron --disable-gpu /path/to/the/app [You mayn't get that Error]

The fix was to add "--disable-gpu" to the command-line to force the web view not to use gpu features. I was able to accomplish this in an electron app by editing the package.json file in app root and changing the line like "start": "electron ." to "start": "electron . --disable-gpu"

Refer https://github.com/electron/electron/issues/7834#issuecomment-275802528

like image 171
Sudhakar Ramasamy Avatar answered Sep 24 '22 04:09

Sudhakar Ramasamy


Based on Sudhakar RS answer , I made a script in my package.json to not use GL

here is my package.json

{
  ...
  "scripts": {
    "start": "electron --disable-gpu .", // --disable GL ERROR and use CPU
    ...
  }
 ...

}

Then in your terminal run

npm run start
like image 45
Nassim Avatar answered Sep 22 '22 04:09

Nassim