quasarframework/quasar · warning

Electron support detected already. Aborting.

Error message

Electron support detected already. Aborting.

What it means

Warning emitted by `quasar mode add electron` when the Electron mode is already installed in the project. The addMode command detects the existing mode, optionally refreshes its dependencies (including a forced reinstall if requested), then aborts the installation instead of duplicating it. This is an intentional early return, not a crash.

Source

Thrown at app-vite/lib/modes/electron/electron-installation.js:29

/**
 * @param {{
 *   ctx: import('../../../types/configuration/context').InternalQuasarContext,
 *   silent: boolean
 * }} options
 */
export async function addMode({ ctx, silent }) {
  const { appPaths, cacheProxy } = ctx

  if (isModeInstalled(appPaths, 'electron')) {
    const forceInstall = await ensureModePackageJsonAndWorkspace(
      'electron',
      ctx
    )
    await ensureModeDeps('electron', ctx, forceInstall)

    if (silent !== true) {
      warn('Electron support detected already. Aborting.')
    }

    return
  }

  const promptSession = await createPromptSession('Installing Electron Mode...')

  const copyTask = promptSession.taskLog({ title: 'Creating /src-electron...' })

  await copyModeWorkspace('electron', ctx)
  fse.copySync(
    appPaths.resolve.cli(`templates/electron/common`),
    appPaths.electronDir
  )

  const hasTypescript = await cacheProxy.getModule('hasTypescript')
  const format = hasTypescript ? 'ts' : 'js'
  fse.copySync(

View on GitHub (pinned to 4841521b5f)

Solutions

  1. No fix needed: the mode is already installed — just run `quasar dev -m electron` or `quasar build -m electron` directly.
  2. If dependencies seem broken, re-run with the force option (e.g. delete node_modules/electron or use the force flag) so ensureModeDeps reinstalls them.
  3. If src-electron exists but is broken/partial, delete it and run `quasar mode add electron` again for a clean scaffold.

Example fix

// before (CI script)
quasar mode add electron
quasar dev -m electron
// after
quasar mode add electron || true
quasar dev -m electron
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'node:fs'
import { join } from 'node:path'
const hasElectronMode = existsSync(join(process.cwd(), 'src-electron'))
if (!hasElectronMode) {
  await execa('quasar', ['mode', 'add', 'electron'])
}
await execa('quasar', ['dev', '-m', 'electron'])

Prevention

When it happens

Trigger: Running `quasar mode add electron` when isModeInstalled(appPaths, 'electron') returns true — i.e. src-electron already exists. Also triggered automatically by `quasar dev`/`quasar build` with electron targets when they internally invoke addMode on an already-configured project, unless silent is true.

Common situations: Re-running the add command after a previous successful install; a CI script or scaffolding template that unconditionally adds the electron mode; running `quasar dev -m electron` in a project that already has src-electron.

Related errors


AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30). Data as JSON: /api/errors/ebb226a147c74b1c. Report an issue: GitHub.