saadeghi/daisyui · error · Error

${error.message}\n${details}

Error message

${error.message}\n${details}

What it means

launchBrowser wraps waitForDebuggingPort in try/catch. On any failure it kills the browser with SIGTERM, collects the captured stderr (last 8KB), and re-throws an Error whose message is the inner error message optionally followed by a newline and the trimmed stderr. This is the user-facing shape for any launch failure (errors 35, 36, 37).

Source

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

    stderr = `${stderr}${chunk}`.slice(-8_000)
  })

  browserProcess.on("error", (error) => {
    spawnError = error
  })

  try {
    const port = await waitForDebuggingPort(
      profileDirectory,
      browserProcess,
      timeoutMs,
      () => spawnError,
    )
    return { browserProcess, port, stderr: () => stderr }
  } catch (error) {
    browserProcess.kill("SIGTERM")
    const details = stderr.trim()
    throw new Error(details ? `${error.message}\n${details}` : error.message)
  }
}

async function stopBrowser(browserProcess) {
  if (!browserProcess || browserProcess.exitCode !== null) return

  browserProcess.kill("SIGTERM")
  await Promise.race([
    new Promise((resolvePromise) => browserProcess.once("exit", resolvePromise)),
    delay(2_000),
  ])

  if (browserProcess.exitCode === null) {
    browserProcess.kill("SIGKILL")
    await new Promise((resolvePromise) => browserProcess.once("exit", resolvePromise))
  }
}

View on GitHub (pinned to 42b09e637e)

Solutions

  1. Read the first line to classify the failure (spawn / exited / timeout).
  2. Read the trailing stderr lines for Chrome's own diagnostic (missing lib, bad flag, sandbox).
  3. Apply the fix matching the inner failure (see errors 35-37).
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await createTailwindPlay({ html, css })
} catch (error) {
  const [firstLine, ...rest] = error.message.split('\n')
  // firstLine: inner failure (spawn / exited / timeout); rest: Chrome stderr
  console.error('launch failed:', firstLine, rest.join('\n'))
}

Prevention

When it happens

Trigger: Any of the inner launch failures: spawn error, early browser exit, or DevTools-port timeout, all surfacing through this wrapper.

Common situations: Operator sees a single combined message; the first line identifies which inner failure occurred and the trailing lines are Chrome's own stderr output.

Related errors


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