electron-userland / electron-prebuilt-compile

electron-prebuilt with Babel and React built-in
167 stars 50 forks source link

Win10-64bit : electron window not launching. #36

Closed benoitroy closed 7 years ago

benoitroy commented 7 years ago

Running into this issue on windows10 64bit (node-8.0.0, npm-5.0.2).

The application window doesn't launch after an npm start or a electron ./app/main.j or a electron . on a very simple hello world type app. However I do see an electron.exe process in TaskManager. If I manually terminate the process I get the following

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron-quick-start@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-quick-start@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ben\AppData\Roaming\npm-cache\_logs\2017-06-18T18_17_45_289Z-debug.log

And inpecting the logs files reveals a stacktrace just like electron/electron-quick-start#155.

The only way I can get this to launch is by using electron-builder with build --ia32 packaging, the 64bit build doesn't launch either.

All is well in Ubuntu 16.04 land.

benoitroy commented 7 years ago

After much headbanging and reading ..which hinted at antivirus software interfering with electron browser windows... I found out that this guy ePowerEvent.exe was the root cause of the issue (this will only exists on Acer computers). Killing the process allows electron apps/windows to launch now.

Closing for good.

gazugafan commented 7 years ago

Ran into this myself today, but somehow didn't come across this issue when googling. Ended up coming to exactly the same conclusion after a days-worth of headbanging and life-questioning. Just want to add some extra context here for other googlers and hopefully help prevent our pain from happening to anyone else...

This affects electron 1.5+. Electron 1.4 and earlier aren't affected. On electron 1.5, electron 1.6, electron 1.7 and onwards, a new browser window will simply not open. There is no other indication that a problem has occurred. I notice two background electron processes running, and one node.js process running. Killing them doesn't result in any error message unless they were started with npm start instead of electron . in which case you get the npm error messages above. This was all tested with the electron quick start app. The electron quick start app won't work.

You might think that your electron app will only run once, or that electron will only open one window. You might notice that electron will only work if you run it immediately when Windows first starts. You might think something is preventing electron from starting. "Why won't my electron window open?", you might ask!

And, as noted above... if you're using an Acer computer, the answer is ePowerEvent.exe. For whatever stupid reason, it messes with electron apps. Kill it, and your problems will magically go away.

I'm going to bed.

wenlilearn commented 7 years ago

I've spent weeks on the issue sparsely. Thank god now I can use all the electron apps. One weird thing though, I noticed that atom was not affected by this. Not too sure what's going on with it. Maybe it's using some other methods of rendering the window? Anyway, thanks to you guys!

petren commented 6 years ago

While the above fix works, it's not ideal to have to have users kill processes on their computers. Many users may download the software and simply think it doesn't work and uninstall. Does anyone know of a solution that can be permanently built into the app?

And thanks @benoitroy for figuring it out, you saved us a lot of time! 👍

artus9033 commented 6 years ago

Just to keep the issue alive - it is still present in electron 1.7.11 and killing ePowerEvent.exe helps. Thanks @benoitroy !

ahadcove commented 6 years ago

I can confirm in 1.7.12 this is still present. And this is even without and ePowerEvent running. Doesn't leave any errors or anything. I can also see that 3 processes of my app start and then one closes leaving only 2 processes, yet I only see one window

jmvallejo commented 6 years ago

I can confirm this is an issue in 1.8.3, killing those processes fixed the issue and we were able to run the app, thanks a lot for this!

mastergberry commented 6 years ago

Does someone in this thread have some javascript code to share to kill these processes automatically on opening of the application?

timsamart commented 5 years ago

I have electron Version 4.1.4 and seemingly the same problem? This is a major drawback for production use is there a good solution?

mastergberry commented 5 years ago

I ended up writing some Windows native code to kill ePowerEvent.exe if I detect it on the system...granted my app is also running with admin mode.

dospolov commented 5 years ago

Clearing cache C:\Users\\AppData\Roaming\ worked for me

spennywallstest commented 5 years ago

How do you kill ePowerEvent.exe!? I can't seem to find it under processes...

beaulieufrancois commented 5 years ago

Clearing cache C:\Users\AppData\Roaming worked for me

Worked for me too

tbrown9164 commented 4 years ago

My particular finding: the packaged Electron App I was running had a space in the file name e.g. 'My App'. On a Windows 7 instance it started fine. On 'A' windows 10 box the execution resulted in nothing...no Electron.exe in TaskMgr or anything. When I did another build, I accidentally created a package without the space "MyApp' and behold, it ran beautifully! The puzzling thing is that I have other apps with spaces in their names. Seems to only affect Electron Apps.

tjaska commented 4 years ago

Clearing cache C:\Users\AppData\Roaming worked for me

You the MVP! Lost hours trying different electron versions and chasing log files. And it started seemingly completely out of the blue. I'm working from office and home workstation, so I usually start with git pull && npm install. This time, after doing the npm install, electron window did not appear. I console.logged in the main.js, and it seemed app never received the ready event.

Deleting app folder from Roaming did the trick. Maybe newer electron version didn't like something in the older Roaming dir?

TimPietrusky commented 4 years ago

If you are here and nothing from the above worked, you might want to remove those lines from src/background.js

  if (isDevelopment && !process.env.IS_TEST) {
    // Install Vue Devtools
    // Devtools extensions are broken in Electron 6.0.0 and greater
    // See https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/378 for more info
    // Electron will not launch with Devtools extensions installed on Windows 10 with dark mode
    // If you are not using Windows 10 dark mode, you may uncomment these lines
    // In addition, if the linked issue is closed, you can upgrade electron and uncomment these lines
    try {
      await installVueDevtools();
    } catch (e) {
      console.error("Vue Devtools failed to install:", e.toString());
    }
  }

This might be fixed with Electron 8.2.5.

kyranjamie commented 4 years ago

Make sure you're only calling MacOS specific methods, like setTrafficLightPosition(), within a Mac environment.

mx51damon commented 2 years ago

Please ensure you have this piece of code setup:

function server(currentWindow) {
  app.on('ready', () => {
    currentWindow.show(); // currentWindow is from parent window setup, something like second part of code
  });
}
windows.main = new Window({
  height: 768,
  hideOnClose: true,
  show: true,
  width: 1024,
});

server(windows.main);