gatsbyjs/gatsby · error

Browser not opened because no browser was found

Error message

Browser not opened because no browser was found

What it means

In gatsby serve's startListening, when the --open flag is set, Gatsby attempts to launch the system browser via openurl. If that promise rejects (no browser available, e.g. headless CI/container), it warns that the browser could not be opened; the server itself is running fine.

Source

Thrown at packages/gatsby/src/commands/serve.ts:375

      console.log(`  ${urls.localUrlForTerminal}`)
    }
  }

  const startListening = (): void => {
    app.listen(port, host, () => {
      const urls = prepareUrls(
        program.ssl ? `https` : `http`,
        program.host,
        port
      )
      printInstructions(
        program.sitePackageJson.name || `(Unnamed package)`,
        urls
      )
      if (open) {
        report.info(`Opening browser...`)
        Promise.resolve(openurl(urls.localUrlForBrowser)).catch(() =>
          report.warn(`Browser not opened because no browser was found`)
        )
      }
    })
  }

  try {
    port = await detectPortInUseAndPrompt(port, program.host)
    startListening()
  } catch (e) {
    if (e.message === `USER_REJECTED`) {
      return
    }

    throw e
  }
}

View on GitHub (pinned to e85d62f177)

Solutions

  1. Open the printed URL manually in a browser
  2. Drop the --open flag in headless/CI environments
  3. Install or configure a default browser on the host
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/gatsby/src/commands/serve.ts:375 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/0d576d45c1f80c45. Report an issue: GitHub.