{"record":{"id":"aafa1a8b218c4c4d","repo":"saadeghi/daisyui","slug":"could-not-focus-tailwind-play-s-label-editor","errorCode":null,"errorMessage":"Could not focus Tailwind Play's ${label} editor.${diagnostics}","messagePattern":"Could not focus Tailwind Play's (.+?) editor\\.(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":778,"sourceCode":"  if (!pasteResult?.ok) {\n    throw new Error(\n      `Tailwind Play's editor did not accept the paste event: ${JSON.stringify(pasteResult)}`,\n    )\n  }\n}\n\nasync function setWithEditorUi(client, html, css, timeoutMs) {\n  for (const [label, source] of [\n    [\"HTML\", html],\n    [\"CSS\", css],\n  ]) {\n    await clickEditorTab(client, label)\n    const focusResult = await focusVisibleEditor(client, label, timeoutMs)\n    if (!focusResult?.ok) {\n      const diagnostics = focusResult?.diagnostics?.length\n        ? ` Editor DOM: ${JSON.stringify(focusResult.diagnostics)}`\n        : \"\"\n      throw new Error(`Could not focus Tailwind Play's ${label} editor.${diagnostics}`)\n    }\n    await replaceActiveEditor(client, source)\n    await delay(150)\n  }\n}\n\nfunction extractSharedUrl(value) {\n  if (typeof value !== \"string\") return undefined\n  const match = value.match(/https:\\/\\/play\\.tailwindcss\\.com\\/[^\\s\"'<>]+/i)\n  if (!match) return undefined\n\n  try {\n    const url = new URL(match[0])\n    const hasShareIdentifier = url.pathname !== \"/\" || url.search !== \"\" || url.hash !== \"\"\n    return url.hostname === \"play.tailwindcss.com\" && hasShareIdentifier ? url.href : undefined\n  } catch {\n    return undefined\n  }","sourceCodeStart":760,"sourceCodeEnd":796,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L760-L796","documentation":"Thrown by setWithEditorUi when focusVisibleEditor never returned an ok result within the deadline for the given label. The diagnostics string, when present, embeds a JSON snapshot of up to 30 candidate editor DOM elements (tag, role, className, dimensions) to show what the focus logic saw.","triggerScenarios":"focusVisibleEditor's do/while loop exits with target.ok falsy because no focusable element scored above 0 and no clickable editor surface (>=40x40) was found before the deadline.","commonSituations":"Tailwind Play's editor mounting changed so none of the scored selectors (.monaco-editor textarea, .cm-content, .ace_text-input, [role=textbox], textarea, [contenteditable]) match, the editor panel is hidden, or the page never finished rendering the editor.","solutions":["Raise --timeout so the editor fully mounts before focus is attempted.","Update tailwind-play-share to pick up selector changes.","Inspect the diagnostics JSON in the error message to see which elements the page actually exposed.","Retry with --headed to observe the editor state visually."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  url = await createTailwindPlay(inputs)\n} catch (error) {\n  if (/Could not focus Tailwind Play's .* editor/.test(error.message)) {\n  // diagnostics JSON lists the candidate editor DOM elements seen\n  }\n  throw error\n}","preventionTips":["Increase --timeout so the editor mounts fully before focus is attempted.","Update tailwind-play-share to track editor selector changes.","Read the embedded Editor DOM diagnostics JSON to see what the page exposed."],"tags":["dom","editor-ui","focus","browser-automation"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}