quasarframework/quasar · warning

Failed to open default browser

Error message

Failed to open default browser

What it means

openBrowser's openDefault calls the `open` npm package to launch the OS default browser at the dev-server URL. The rejection is only logged (console.error) and announced with this warning — it is non-fatal, so the dev server keeps running. It means the OS-level browser launch failed, not that the URL is wrong.

Source

Thrown at app-vite/lib/utils/open-browser.js:13

import open from 'open'

import { log, warn } from './logger.js'

export function openBrowser({ url, opts, wait = true }) {
  const openDefault = () => {
    log('Opening default browser at ' + url + '\n')

    open(url, {
      wait
    }).catch(err => {
      console.error(err)
      warn('Failed to open default browser')
      warn()
    })
  }

  if (opts) {
    log('Opening browser at ' + url + ' with options: ' + JSON.stringify(opts))
    log()
    open(url, {
      ...opts,
      wait
    }).catch(err => {
      console.error(err)
      warn('Failed to open specific browser')
      warn()
      openDefault()
    })
  } else {
    openDefault()

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Read the console.error output under the warning — it names the OS-level cause (e.g. xdg-open not found)
  2. Install a browser / xdg-utils on Linux (`sudo apt install xdg-utils` or a browser package)
  3. Disable auto-open in headless environments: set `devServer.open: false` in quasar.config or omit the --open flag
  4. Open the printed URL manually in any browser on your network-accessible machine

Example fix

// before (quasar.config.js) on a headless CI
devServer: { server: { open: true } }
// after
devServer: { server: { open: false } }
Defensive patterns

Strategy: fallback

Validate before calling

// headless environments: detect before enabling auto-open
const isHeadless = !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY && process.platform === 'linux'
const shouldOpen = !isHeadless && !process.env.CI

Prevention

When it happens

Trigger: `quasar dev` with `devServer.open: true` (or the --open flag) on a system where the `open` package's platform helper (xdg-open on Linux, `open` on macOS, `start` on Windows/WSL) fails or is missing.

Common situations: Headless Linux servers/CI without any browser or xdg-utils installed; WSL without a Windows browser association; SSH sessions without DISPLAY; containers with no desktop environment.

Related errors


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