{"record":{"id":"b16d3993a88b3aec","repo":"saadeghi/daisyui","slug":"could-not-find-tailwind-play-s-label-editor-tab","errorCode":null,"errorMessage":"Could not find Tailwind Play's ${label} editor tab","messagePattern":"Could not find Tailwind Play's (.+?) editor tab","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":578,"sourceCode":"  const clicked = await evaluate(\n    client,\n    `(() => {\n      const normalize = (value) => value?.replace(/\\\\s+/g, \" \").trim().toLowerCase() ?? \"\";\n      const visible = (element) => {\n        const rect = element.getBoundingClientRect();\n        const style = getComputedStyle(element);\n        return rect.width > 0 && rect.height > 0 && style.visibility !== \"hidden\" && style.display !== \"none\";\n      };\n      const target = [...document.querySelectorAll(\"button,[role=tab]\")]\n        .filter(visible)\n        .find((element) => normalize(element.textContent) === ${JSON.stringify(label.toLowerCase())});\n      if (!target) return false;\n      target.click();\n      return true;\n    })()`,\n  )\n\n  if (!clicked) throw new Error(`Could not find Tailwind Play's ${label} editor tab`)\n  await delay(150)\n}\n\nasync function focusVisibleEditor(client, label, timeoutMs) {\n  const deadline = Date.now() + timeoutMs\n  let target\n\n  do {\n    target = await evaluate(\n      client,\n      `(() => {\n      const normalize = (value) => value?.replace(/\\\\s+/g, \" \").trim().toLowerCase() ?? \"\";\n      const visible = (element) => {\n        const rect = element.getBoundingClientRect();\n        const style = getComputedStyle(element);\n        return rect.width > 0 && rect.height > 0 && style.visibility !== \"hidden\" && style.display !== \"none\";\n      };\n","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L560-L596","documentation":"Thrown by clickEditorTab when no visible button or [role=tab] element whose normalized text equals the requested label (\"HTML\" or \"CSS\") could be found. This runs only in the keyboard/UI fallback path setWithEditorUi, used when the Monaco model API was not accessible.","triggerScenarios":"evaluate() returns clicked === false because the querySelectorAll(\"button,[role=tab]\") filter found no visible element whose textContent lowercases to \"html\"/\"css\".","commonSituations":"Tailwind Play redesigned its editor chrome so the HTML/CSS tabs are no longer labeled or structured as the script expects, the page is still rendering when the click is attempted, or a different locale changes the tab labels.","solutions":["Update tailwind-play-share; the tab selector is UI-coupled and tracked upstream.","Raise --timeout so tabs are present before the fallback runs.","Run with --verbose and --headed to inspect the live tab labels.","Retry once; transient render races can miss the tab."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  url = await createTailwindPlay(inputs)\n} catch (error) {\n  if (/Could not find Tailwind Play's .* editor tab/.test(error.message)) {\n  // UI coupling broke; update the script or retry after raising timeout\n  }\n  throw error\n}","preventionTips":["Update tailwind-play-share when Tailwind Play ships UI changes.","Raise --timeout so tabs are present before the fallback path runs.","Use --headed to inspect the actual tab labels when debugging."],"tags":["dom","editor-ui","tailwind-play","browser-automation"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}