question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Electron 6.0.0+ does not launch in Windows 10 Dark Mode

See original GitHub issue

Describe the bug When using vue-cli-plugin-electron-builder with the Electron 6.0.0, it hangs and Electron is not launched if Windows 10’s dark mode is enabled. It works fine in light mode.

This is due to a bug introduced in electron@6.0.0-beta.14 which causes Electron to hang on launch in Win10 dark mode if any dev tools extensions are installed. VCPEB installs Vue.js Devtools automatically, triggering this bug.

To Reproduce Steps to reproduce the behaviour:

  1. Ensure Windows “choose your color” setting is set to “Dark”.
  2. vue create test (accept all defaults)
  3. cd test
  4. vue add electron-builder (accept all defaults)
  5. npm i electron@6.0.0-beta.15
  6. npm run electron:serve

Expected behaviour Electron should launch regardless of whether Windows is in Light or Dark mode.

Environment

  • OS and version: Windows 10 Home 1903
  • node version: 12.7.0
  • npm version: 6.10.0
  • yarn version (if used): n/a
  • vue-cli-plugin-electron-builder version: 1.3.6
  • electron version: 6.0.0
  • other vue plugins used: none
  • custom config for vcp-electron-builder: none
  • (if possible) link to your repo: n/a

Additional context See https://github.com/electron/electron/issues/19468 for the Electron bug which causes this issue.

Workaround for now is to disable the automatic installation of Vue.js Devtools in background.js, and delete your app’s data directory in %appdata% to remove already-installed devtools.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:23 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
nklaymancommented, Aug 3, 2019

In v1.4.0 of this plugin, I added support for Electron 6. If Eelctron 6 is selected when adding the plugin, the vue devtools install will be commented out and a message will explain the problem and link to this issue. Thanks for all of your help investigating! I will leave this issue open until it is solved by electron.

4reactions
ChrisKadercommented, Jan 9, 2020

@echo off %1 %2 mshta vbscript:createobject(“shell.application”).shellexecute(“%~s0”,“goto :runas”,“”,“runas”,1)(window.close)&goto :uacfalse :runas REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize /v AppsUseLightTheme /t REG_DWORD /d 1 /f goto :eof :uacfalse

Admin rights are not needed to modify these registry variables. Further, running any application (Especially VSCode) as administrator for no reason is a very ignorant recommendation.

Below are 3 scripts that can be added to your package.json that will enable light mode, execute electron:serve and then enable dark mode when the electron process ends. They do NOT require admin rights. This COULD actually be merged into just one script but modularity is key, right?

"electron:light": "yarn win-light && yarn electron:serve && yarn win-dark",
"win-light": "REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize /v AppsUseLightTheme /t REG_DWORD /d 1 /f",
"win-dark": "REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize /v AppsUseLightTheme /t REG_DWORD /d 0 /f",
Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Answers - 3 - Stack Overflow
The Windows 10 Anniversary Update introduced a dark mode, where most supporting apps will change their color palette to be dark. I want...
Read more >
Dark Mode | Electron
If your Electron app has a dark mode, you can make it follow the system-wide dark mode setting using the nativeTheme api. In...
Read more >
Blog - Apache Cordova
By passing down all attribute data, Cordova-Common no longer needs to be ... splashscreen images when your app is running in dark mode....
Read more >
ASP.NET Core updates in .NET 6 Preview 4
You can't currently run the app for iOS or Mac Catalyst from a Windows development environment, although we do expect that .NET MAUI...
Read more >
Building a deployable Python-Electron App | by Andy Bulka
I built and released both a Windows and Mac version of my app. ... the Electron GUI and Python 3 using remote procedure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found