{"record":{"id":"8b15344f3ed53eff","repo":"saadeghi/daisyui","slug":"chrome-or-chromium-was-not-found-set-tailwind-pla","errorCode":null,"errorMessage":"Chrome or Chromium was not found. Set TAILWIND_PLAY_BROWSER or pass --browser <path>.","messagePattern":"Chrome or Chromium was not found\\. Set TAILWIND_PLAY_BROWSER or pass --browser <path>\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":250,"sourceCode":"      \"chromium-browser\",\n      \"microsoft-edge\",\n    ],\n    win32: [\n      process.env.LOCALAPPDATA &&\n        join(process.env.LOCALAPPDATA, \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n      process.env.PROGRAMFILES &&\n        join(process.env.PROGRAMFILES, \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n      process.env[\"PROGRAMFILES(X86)\"] &&\n        join(process.env[\"PROGRAMFILES(X86)\"], \"Google\", \"Chrome\", \"Application\", \"chrome.exe\"),\n    ].filter(Boolean),\n  }\n\n  for (const candidate of platformCandidates[process.platform] ?? []) {\n    const executable = await resolveExecutable(candidate)\n    if (executable) return executable\n  }\n\n  throw new Error(\n    \"Chrome or Chromium was not found. Set TAILWIND_PLAY_BROWSER or pass --browser <path>.\",\n  )\n}\n\nconst delay = (milliseconds) =>\n  new Promise((resolvePromise) => setTimeout(resolvePromise, milliseconds))\n\nasync function waitForDebuggingPort(profileDirectory, browserProcess, timeoutMs, getSpawnError) {\n  const activePortFile = join(profileDirectory, \"DevToolsActivePort\")\n  const deadline = Date.now() + timeoutMs\n\n  while (Date.now() < deadline) {\n    const spawnError = getSpawnError()\n    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})`)","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L232-L268","documentation":"If no explicit browser is configured, findBrowser walks hardcoded per-platform candidates (macOS app paths, Linux binary names on PATH, Windows Program Files locations). If none resolves to an executable, it throws telling the user to set TAILWIND_PLAY_BROWSER or pass --browser.","triggerScenarios":"Running on a machine/container without Chrome, Chromium, or Edge installed in any of the probed locations; PATH does not include the browser directory.","commonSituations":"Fresh CI runner (Alpine, slim Docker image); Linux server with Chrome installed under a non-standard prefix; headless container with only chromium-sandbox stripped.","solutions":["Install Chrome or Chromium in a standard location.","Set TAILWIND_PLAY_BROWSER (or CHROME_PATH) to the binary path.","Pass --browser <path> explicitly for this run."],"exampleFix":"# before (no chrome installed)\nbun .../index.mjs --html '<div/>'\n# after\napt-get install -y chromium \\\n  && TAILWIND_PLAY_BROWSER=/usr/bin/chromium bun .../index.mjs --html '<div/>'","handlingStrategy":"validation","validationCode":"import { access, constants } from 'node:fs/promises'\nasync function hasAnyBrowser(candidates) {\n  for (const c of candidates) { try { await access(c, constants.X_OK); return c } catch {} }\n  return undefined\n}","typeGuard":null,"tryCatchPattern":"try {\n  await createTailwindPlay({ html, css })\n} catch (error) {\n  if (/was not found/.test(error.message)) {\n    // install a browser, then set TAILWIND_PLAY_BROWSER, then retry\n  }\n}","preventionTips":["Install Chrome/Chromium on CI images before running.","Set TAILWIND_PLAY_BROWSER to a known path in container environments.","Pre-validate browser availability in your script's bootstrap."],"tags":["browser","environment","chrome","setup"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}