{"record":{"id":"5cc2f8b6ab35e416","repo":"iOfficeAI/AionUi","slug":"aionui-web-could-not-open-the-browser-automatica","errorCode":null,"errorMessage":"[aionui-web] could not open the browser automatically: ${openResult.reason}","messagePattern":"\\[aionui-web\\] could not open the browser automatically: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/web-cli/src/index.ts","lineNumber":193,"sourceCode":"\n    const handle = await startStaticServer({\n      staticDir,\n      backendPort: 0, // invalid port → API proxy will fail cleanly\n      port,\n      allowRemote,\n    });\n    currentHandle = handle;\n\n    console.log('');\n    console.log('AionUi WebUI (frontend only) is ready');\n    console.log(`  Local  : ${handle.localUrl}`);\n    if (handle.networkUrl) console.log(`  Network: ${handle.networkUrl}`);\n    if (autoOpenBrowser) {\n      const openResult = openBrowserUrl(handle.localUrl);\n      if (openResult.ok) {\n        console.log(`[aionui-web] opened ${handle.localUrl} in your browser.`);\n      } else {\n        console.warn(`[aionui-web] could not open the browser automatically: ${openResult.reason}`);\n      }\n    }\n    console.log('');\n    console.log('Press Ctrl+C to stop.');\n  } else {\n    const handle = await startWebHost({\n      app: {\n        version,\n        isPackaged: true,\n        resourcesPath: cliRoot,\n        userDataPath: dataDir,\n      },\n      staticDir,\n      port,\n      allowRemote,\n      dataDir,\n      logDir,\n      dirs: {","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/iOfficeAI/AionUi/blob/711aa0550ee183ea495dc33e2c05c7943b70a60a/packages/web-cli/src/index.ts#L175-L211","documentation":"Warning printed when the CLI's static-server (frontend-only path) mode tried to auto-open the user's browser via openBrowserUrl and it failed. The server is still running fine; only the convenience of opening the URL automatically was lost. The reason string from openBrowserUrl explains the underlying cause (e.g. no BROWSER, headless environment, unsupported platform opener).","triggerScenarios":"Starting with auto-open enabled on a headless/SSH session, a container/CI environment, a server without xdg-open/open/start, or with an invalid $BROWSER env var.","commonSituations":"Running the web CLI inside Docker or over SSH without X forwarding; minimal Linux images lacking xdg-open; CI pipelines that start the server; $BROWSER set to a broken command.","solutions":["Ignore the warning and open handle.localUrl manually in a browser.","Pass the no-auto-open flag (or disable autoOpenBrowser in options) in headless/CI environments.","Install xdg-open (xdg-utils package) or set $BROWSER to a valid browser command on Linux.","Use port forwarding (ssh -L) when running remotely and open the local URL."],"exampleFix":"# before\naionui-web start  # warns: could not open the browser automatically\n\n# after\naionui-web start --no-open  # (or equivalent flag) then open http://localhost:<port> manually","handlingStrategy":"fallback","validationCode":"const isHeadless = !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY && process.platform === 'linux';\nconst autoOpenBrowser = !isHeadless && !process.env.CI;","typeGuard":null,"tryCatchPattern":"const openResult = openBrowserUrl(handle.localUrl);\nif (!openResult.ok) {\n  // non-fatal: server is running; just surface URL for manual open\n  console.warn(`Open manually: ${handle.localUrl} (${openResult.reason})`);\n}","preventionTips":["Disable auto-open in Docker/CI/SSH environments.","Print the local URL unconditionally so manual open is always possible.","On Linux, ensure xdg-utils is installed or set $BROWSER."],"tags":["browser-open","headless","cli","non-fatal"],"backgroundTag":"browser-launch-failed","analyzedSha":"711aa0550ee183ea495dc33e2c05c7943b70a60a","analyzedAt":"2026-08-28T07:56:06.558Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}