{"record":{"id":"28dc61467aab6b71","repo":"saadeghi/daisyui","slug":"timed-out-while-starting-chrome-s-devtools-server","errorCode":null,"errorMessage":"Timed out while starting Chrome's DevTools server","messagePattern":"Timed out while starting Chrome's DevTools server","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":282,"sourceCode":"    if (spawnError) {\n      throw new Error(`Could not start the browser: ${spawnError.message}`)\n    }\n    if (browserProcess.exitCode !== null) {\n      throw new Error(`Browser exited before starting (exit code ${browserProcess.exitCode})`)\n    }\n\n    try {\n      const [portText] = (await readFile(activePortFile, \"utf8\")).trim().split(/\\r?\\n/)\n      const port = Number(portText)\n      if (Number.isInteger(port) && port > 0) return port\n    } catch {\n      // Chrome creates this file after its DevTools server is ready.\n    }\n\n    await delay(50)\n  }\n\n  throw new Error(\"Timed out while starting Chrome's DevTools server\")\n}\n\nasync function launchBrowser(executable, { headed, profileDirectory, timeoutMs }) {\n  const args = [\n    \"--remote-debugging-port=0\",\n    \"--remote-allow-origins=*\",\n    `--user-data-dir=${profileDirectory}`,\n    \"--no-first-run\",\n    \"--no-default-browser-check\",\n    \"--disable-background-networking\",\n    \"--disable-component-update\",\n    \"--disable-default-apps\",\n    \"--disable-extensions\",\n    \"--disable-sync\",\n    \"--metrics-recording-only\",\n    \"--mute-audio\",\n    \"--window-size=1440,1000\",\n  ]","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L264-L300","documentation":"waitForDebuggingPort loops until Date.now() passes the deadline (timeoutMs from --timeout, default 45000). If neither a spawn error, an early exit, nor a valid DevToolsActivePort file appears in time, it throws this timeout.","triggerScenarios":"Chrome is slow to open its DevTools server under heavy load; the timeout was set very low; Chrome hung silently without exiting.","commonSituations":"CI runner under CPU/memory pressure; cold start on a throttled machine; default 45s exceeded on a large shared runner; very low --timeout value.","solutions":["Increase --timeout (e.g. --timeout 90000).","Reduce machine load or run on a faster runner.","Confirm Chrome is not waiting on a missing sandbox/library (which usually produces error 36 instead)."],"exampleFix":"# before\nbun .../index.mjs --timeout 5000 --html '<div/>'\n# after\nbun .../index.mjs --timeout 90000 --html '<div/>'","handlingStrategy":"retry","validationCode":"// Pick a timeout appropriate to the host before launching.\nconst timeoutMs = Math.max(Number(process.env.TPW_TIMEOUT ?? 45_000), 45_000)","typeGuard":null,"tryCatchPattern":"for (let attempt = 0; attempt < 2; attempt += 1) {\n  try { return await createTailwindPlay({ ...opts, timeoutMs: 90_000 }) }\n  catch (error) {\n    if (/Timed out while starting Chrome's DevTools server/.test(error.message) && attempt === 0) continue\n    throw error\n  }\n}","preventionTips":["Raise --timeout on slow or shared CI runners.","Reduce concurrent load on the host during browser startup.","Pre-warm Chrome once at the start of a CI job."],"tags":["browser","timeout","chrome","devtools"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}