Troubleshooting and Tips

Browser Devtools

You probably want your app to only give access to the browser devtools on dev mode only. On the production version (without debugging enabled) you’ll want to disable this behavior.

While we’re at it, why not also open devtools by default when we’re on dev mode.

// electron-main.[js|ts]

function createWindow () {
  mainWindow = new BrowserWindow({ ... })

  if (process.env.DEBUGGING) {
    // if on DEV or Production with debug enabled
  else {
    // we're on production; no access to devtools pls
    mainWindow.webContents.on('devtools-opened', () => {

Debugging Main Process

When running your application in development you may have noticed a message from the main process mentioning a remote debugger. Ever since the release of electron@^1.7.2, remote debugging over the Inspect API was introduced and can be easily accessed by opening the provided link with Google Chrome or through another debugger that can remotely attach to the process using the default port of 5858, such as Visual Studio Code.

Debugger listening on ws://
For help, see:

Application does not open on Windows with Dark Theme

Some Chrome DevTools Extensions do not play well with Windows Dark Theme on electron 6+. Quasar offers a workaround in the default electron-main.js, that removes the DevTools Extensions before starting the application.

import { app, BrowserWindow, nativeTheme } from 'electron'

try {
  if (process.platform === 'win32' && nativeTheme.shouldUseDarkColors === true) {
    require('fs').unlinkSync(require('path').join(app.getPath('userData'), 'DevTools Extensions'))
} catch (_) { }

Please follow electron bug report for more details.