{"record":{"id":"0d576d45c1f80c45","repo":"gatsbyjs/gatsby","slug":"browser-not-opened-because-no-browser-was-found","errorCode":null,"errorMessage":"Browser not opened because no browser was found","messagePattern":"Browser not opened because no browser was found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/commands/serve.ts","lineNumber":375,"sourceCode":"      console.log(`  ${urls.localUrlForTerminal}`)\n    }\n  }\n\n  const startListening = (): void => {\n    app.listen(port, host, () => {\n      const urls = prepareUrls(\n        program.ssl ? `https` : `http`,\n        program.host,\n        port\n      )\n      printInstructions(\n        program.sitePackageJson.name || `(Unnamed package)`,\n        urls\n      )\n      if (open) {\n        report.info(`Opening browser...`)\n        Promise.resolve(openurl(urls.localUrlForBrowser)).catch(() =>\n          report.warn(`Browser not opened because no browser was found`)\n        )\n      }\n    })\n  }\n\n  try {\n    port = await detectPortInUseAndPrompt(port, program.host)\n    startListening()\n  } catch (e) {\n    if (e.message === `USER_REJECTED`) {\n      return\n    }\n\n    throw e\n  }\n}\n","sourceCodeStart":357,"sourceCodeEnd":392,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/commands/serve.ts#L357-L392","documentation":"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.","triggerScenarios":"Thrown at packages/gatsby/src/commands/serve.ts:375 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the printed URL manually in a browser","Drop the --open flag in headless/CI environments","Install or configure a default browser on the host"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}