saadeghi/daisyui · error · Error

Timed out while starting Chrome's DevTools server

Error message

Timed out while starting Chrome's DevTools server

What it means

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.

Source

Thrown at packages/tailwind-play-share/index.mjs:282

    if (spawnError) {
      throw new Error(`Could not start the browser: ${spawnError.message}`)
    }
    if (browserProcess.exitCode !== null) {
      throw new Error(`Browser exited before starting (exit code ${browserProcess.exitCode})`)
    }

    try {
      const [portText] = (await readFile(activePortFile, "utf8")).trim().split(/\r?\n/)
      const port = Number(portText)
      if (Number.isInteger(port) && port > 0) return port
    } catch {
      // Chrome creates this file after its DevTools server is ready.
    }

    await delay(50)
  }

  throw new Error("Timed out while starting Chrome's DevTools server")
}

async function launchBrowser(executable, { headed, profileDirectory, timeoutMs }) {
  const args = [
    "--remote-debugging-port=0",
    "--remote-allow-origins=*",
    `--user-data-dir=${profileDirectory}`,
    "--no-first-run",
    "--no-default-browser-check",
    "--disable-background-networking",
    "--disable-component-update",
    "--disable-default-apps",
    "--disable-extensions",
    "--disable-sync",
    "--metrics-recording-only",
    "--mute-audio",
    "--window-size=1440,1000",
  ]

View on GitHub (pinned to 42b09e637e)

Solutions

  1. Increase --timeout (e.g. --timeout 90000).
  2. Reduce machine load or run on a faster runner.
  3. Confirm Chrome is not waiting on a missing sandbox/library (which usually produces error 36 instead).

Example fix

# before
bun .../index.mjs --timeout 5000 --html '<div/>'
# after
bun .../index.mjs --timeout 90000 --html '<div/>'
Defensive patterns

Strategy: retry

Validate before calling

// Pick a timeout appropriate to the host before launching.
const timeoutMs = Math.max(Number(process.env.TPW_TIMEOUT ?? 45_000), 45_000)

Try / catch

for (let attempt = 0; attempt < 2; attempt += 1) {
  try { return await createTailwindPlay({ ...opts, timeoutMs: 90_000 }) }
  catch (error) {
    if (/Timed out while starting Chrome's DevTools server/.test(error.message) && attempt === 0) continue
    throw error
  }
}

Prevention

When it happens

Trigger: Chrome is slow to open its DevTools server under heavy load; the timeout was set very low; Chrome hung silently without exiting.

Common situations: CI runner under CPU/memory pressure; cold start on a throttled machine; default 45s exceeded on a large shared runner; very low --timeout value.

Understand the failure class

Related errors


AI-assisted analysis of saadeghi/daisyui@42b09e637e (2026-08-13). Data as JSON: /api/errors/28dc61467aab6b71. Report an issue: GitHub.