{"record":{"id":"100f5ac89cbe1061","repo":"saadeghi/daisyui","slug":"timed-out-waiting-for-label-lastvalue-j","errorCode":null,"errorMessage":"Timed out waiting for ${label}${lastValue ? `: ${JSON.stringify(lastValue)}` : \"\"}","messagePattern":"Timed out waiting for (.+?)(.+?)` : \"\"\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tailwind-play-share/index.mjs","lineNumber":458,"sourceCode":"      response.exceptionDetails.text ??\n      \"Unknown page evaluation error\"\n    throw new Error(description)\n  }\n\n  return response.result?.value\n}\n\nasync function waitForPageValue(client, expression, timeoutMs, label) {\n  const deadline = Date.now() + timeoutMs\n  let lastValue\n\n  while (Date.now() < deadline) {\n    lastValue = await evaluate(client, expression)\n    if (lastValue) return lastValue\n    await delay(100)\n  }\n\n  throw new Error(\n    `Timed out waiting for ${label}${lastValue ? `: ${JSON.stringify(lastValue)}` : \"\"}`,\n  )\n}\n\nconst clipboardCaptureScript = String.raw`\n(() => {\n  const remember = (value) => {\n    if (value !== undefined && value !== null) {\n      globalThis.__tailwindPlaySharedUrl = String(value);\n    }\n  };\n\n  try {\n    const clipboard = navigator.clipboard;\n    const prototype = clipboard && Object.getPrototypeOf(clipboard);\n    const originalWriteText = prototype?.writeText;\n    if (typeof originalWriteText === \"function\") {\n      Object.defineProperty(prototype, \"writeText\", {","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/saadeghi/daisyui/blob/42b09e637e09467aa54a813a5aea53c1179aec75/packages/tailwind-play-share/index.mjs#L440-L476","documentation":"Thrown by waitForPageValue when its polling loop reached the deadline without the page-side expression ever returning a truthy value. The label identifies what was being waited for (e.g. \"the Tailwind Play editor\", \"Tailwind Play to load\"); lastValue, if any, is included as JSON.","triggerScenarios":"Called from waitForEditor or the document.readyState/initialUrl waits inside createTailwindPlay. Each 100ms tick calls evaluate(); if no tick returns a truthy value before Date.now() exceeds deadline (now + timeoutMs), it throws.","commonSituations":"Slow machine or network so Tailwind Play has not finished bootstrapping Monaco within timeoutMs, Tailwind Play is blocked/down, the browser is resource-starved in CI, or timeoutMs was set too low.","solutions":["Increase --timeout (e.g. --timeout 90000) to give the page more time to load and mount its editor.","Run with --headed locally to see whether the page is actually loading.","Check network connectivity to https://play.tailwindcss.com/ from the host.","Retry in CI; cold-cache loads are the usual culprit."],"exampleFix":"// before\nconst url = await createTailwindPlay({ html, css, timeoutMs: 45000 })\n\n// after\nconst url = await createTailwindPlay({ html, css, timeoutMs: 120000 })","handlingStrategy":"retry","validationCode":"// Validate timeout is generous enough for a cold Tailwind Play load.\nfunction adequateTimeout(timeoutMs) {\n  return Number.isFinite(timeoutMs) && timeoutMs >= 30000\n}","typeGuard":null,"tryCatchPattern":"try {\n  url = await createTailwindPlay({ ...inputs, timeoutMs: 90000 })\n} catch (error) {\n  if (error.message.startsWith(\"Timed out waiting for \")) {\n  // network/load slowness; retry with a higher timeout\n  }\n  throw error\n}","preventionTips":["Set --timeout to >= 60000 in CI where loads are slower.","Confirm network access to play.tailwindcss.com from the runner.","Retry once; cold-cache loads frequently trip this."],"tags":["timeout","polling","page-load","browser-automation"],"backgroundTag":null,"analyzedSha":"42b09e637e09467aa54a813a5aea53c1179aec75","analyzedAt":"2026-08-13T04:10:09.555Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}