saadeghi/daisyui · error · Error

Could not find Tailwind Play's Share button. Visible control

Error message

Could not find Tailwind Play's Share button. Visible controls: ${result?.labels?.join(", ") || "none"}

What it means

Thrown by clickShare when no visible button, anchor, or [role=button] matched any of the Share-button heuristics (aria-label/title equal to "share", text equal to/starting with "share", or a \bshare\b regex). The error lists up to 30 visible control labels so you can see what the toolbar actually contained.

Source

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

            .map(normalize)
            .some((value) => /\bshare\b/.test(value)),
        );
      if (!target) {
        return {
          ok: false,
          labels: candidates
            .map((element) => normalize(element.textContent || element.getAttribute("aria-label")))
            .filter(Boolean)
            .slice(0, 30),
        };
      }
      target.click();
      return { ok: true };
    })()`,
  )

  if (!result?.ok) {
    throw new Error(
      `Could not find Tailwind Play's Share button. Visible controls: ${result?.labels?.join(", ") || "none"}`,
    )
  }
}

async function readShareState(client) {
  return evaluate(
    client,
    String.raw`(() => {
      const visible = (element) => {
        const rect = element.getBoundingClientRect();
        const style = getComputedStyle(element);
        return rect.width > 0 && rect.height > 0 && style.visibility !== "hidden" && style.display !== "none";
      };
      const values = [...document.querySelectorAll("input,textarea")]
        .filter(visible)
        .map((element) => element.value)
        .filter((value) => typeof value === "string" && value.includes("play.tailwindcss.com"));

View on GitHub (pinned to 42b09e637e)

Solutions

  1. Update tailwind-play-share; the share-button matcher is coupled to Tailwind Play's toolbar markup.
  2. Raise --timeout so the toolbar is present before the share click runs.
  3. Run with --verbose/--headed and inspect the visible-control labels in the error.
  4. Retry once; toolbar render races cause this.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  url = await createTailwindPlay(inputs)
} catch (error) {
  if (error.message.startsWith("Could not find Tailwind Play's Share button")) {
  // the message lists visible toolbar labels - compare against current UI
  }
  throw error
}

Prevention

When it happens

Trigger: evaluate() in clickShare returns result.ok falsy because the candidates filter chain found no matching element, so it returns { ok: false, labels: [...] }.

Common situations: Tailwind Play renamed or restructured its Share control (e.g. moved it into a menu, changed the label/localized it), the toolbar had not rendered yet, or an A/B test changed the button.

Related errors


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