electron: Electron 6 does not launch in Win10 dark mode with DevTools extensions installed
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
- Electron Version:
- 6.0.0
- Operating System:
- Windows 10 (1903)
- Last Known Working Electron version:
- 6.0.0-beta.13
Expected Behavior
Electron should launch and display a window regardless of whether Windows is in Light or Dark mode.
Actual Behavior
If Windows is in Dark Mode, then Electron will hang on launch if any DevTools extension is installed.
This behaviour only occurs if a devtools extension has been installed on a previous run.
Everything is fine if Windows is in Light mode when the app is launched.
To Reproduce
UPDATED REPRO (see comment history for original version)
- Ensure Windows “choose your color” setting is set to “Dark”.
- Clone and install repro and launch Electron:
The first time, Electron will launch normally.$ git clone https://github.com/caesar/electron-darkmode-crash.git $ cd electron-darkmode-crash $ npm i $ npm run start - Once electron has launched, close it.
- Launch Electron again:
The second time, Electron will hang and never display a window.$ npm run start
The above repro contains the following changes from electron-quick-start:master : https://github.com/caesar/electron-darkmode-crash/commit/65ab2a0bec0e4a9baca6a9cb2cbfda94817c4ae9
Additional Information
I originally thought this might be an issue with vue-cli-plugin-electron-builder and filed a bug at https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/378, but that possibility has now been eliminated as simply installing Vue.js Devtools or React Devtools in a clean clone of electron-quick-start is enough to trigger the bug.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 67
- Comments: 57 (19 by maintainers)
Commits related to this issue
- Update Dependencies (#29) Used electron 5.0 instead of 6.0, see electron/electron#19468 — committed to sapic/sapic-ne by TheOddball 5 years ago
@MarshallOfSound hey there, any news from the team about this?
@caesar Because the issue only comes into play with devtools extensions it’s not serious enough to block the release. It’s definitely on the list of things to fix though.
@MarshallOfSound any news? This should be high priority
I don’t get why this painful issue isn’t yet solved. The issue is 6 month old and I believe it’s affecting a lot of people ? Is there any technical challenge hard to solve ?
This issue is still relevant in Electron 8.0.0
This issue is present in electron
7.1.10as well.@MarshallOfSound it’s blocking us from upgrading because of this:
We sometimes use our own debug mode on customers machines, which will install devtools extensions. If a customer, or even one of our own developers, runs into this bug, there’s no easy search term given the log messages and the behavior of the app that will lead them to the “turn off dark mode” solution. It’s going to be a frustrating time. Plus, based on this thread, it sounds like the exact problem is unclear, so I’m worried this will repro in more cases than what’s listed.
I’m able to reproduce this on the latest electron version (7.1.9)
I’m facing the same problem. Now, I just write two tricky cmd script to change windows theme mode automaticly when developing.
dark.cmd
light.cmd
some “scripts” lines in my package.json:
I’m not sure if I could just change back the theme after electron started. The scripts just change the registry of the theme selection, the UAC related lines could also be removed.
Found temporary fix for this, add the following script to package.json
And, instead of using
yarn devcommand, useyarn dev:light. Basically it just switch the app theme into light without opening setting menu. Hope this help. sourceWorkaround: https://gist.github.com/LuminescentMoon/f7a180a6960d4d1b9b7e72acb1c77275
Can 100% confirm this is an Electron bug now: same issue with React Devtools.
@DalderupMaurice Maybe you have to do this:
I’ve been using @wmhilton 's workaround (posted a few comments above) for a while and it works very well.
After removing the complete directory, I still wasn’t able to launch the application in both light and dark mode.
One interesting fact is that, after deleting the directory, I did manage to get it working by adjusting the start command.
First I used
electron .with themainproperty in mypackage.jsonset to./dist/index.jsChanging the command toelectron ./dist/index.jsfixed the issue. I am now able to launch the application in both light and dark mode (WITHOUT devtools installed).@MarshallOfSound just wondering, since 6.0.0 release seems to be scheduled for tomorrow – this seems like a pretty serious issue, is it considered a blocker for the release?
I unfortunately don’t have an environment capable of building Electron at the moment or I’d do more to look into this, but I guess a
git bisecton the few commits between beta-13 and beta-14 would at least find where the regression was introduced…