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
- Read the first line to classify the failure (spawn / exited / timeout).
- Read the trailing stderr lines for Chrome's own diagnostic (missing lib, bad flag, sandbox).
- 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
- Treat the first line as the failure category and the rest as Chrome's stderr.
- Log the full message verbatim for post-mortem.
- Map each category to its targeted fix (errors 35-37).
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
- Could not start the browser: ${spawnError.message}
- Browser exited before starting (exit code ${browserProcess.e
- Browser executable not found or not executable: ${configured
- Chrome or Chromium was not found. Set TAILWIND_PLAY_BROWSER
- Timed out while starting Chrome's DevTools server
AI-assisted analysis of saadeghi/daisyui@42b09e637e (2026-08-13).
Data as JSON: /api/errors/c991c73d7262dbcb.
Report an issue: GitHub.