{"record":{"id":"87ba36df612777bb","repo":"pbakaus/impeccable","slug":"impeccable-shader-resume-failed","errorCode":null,"errorMessage":"[impeccable] shader resume failed:","messagePattern":"\\[impeccable\\] shader resume failed:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"skill/scripts/live-browser.js","lineNumber":9238,"sourceCode":"\n    // If we reloaded mid-generation (Bun's HTML HMR destroys the shader\n    // canvas), re-capture the original's content and restart the shader so\n    // the wait doesn't go dead.\n    if (state === 'GENERATING') {\n      const shaderTarget = isInsert\n        ? (ensureInsertPlaceholder() || findInsertAnchorInDom())\n        : origEl;\n      if (shaderTarget) {\n        (async () => {\n          try {\n            const rect = shaderTarget.getBoundingClientRect();\n            if (rect.width === 0 || rect.height === 0) return;\n            const { blob, paper } = await captureElementToBlob(shaderTarget, null, rect);\n            if (blob && state === 'GENERATING') {\n              showShaderOverlay(shaderTarget, blob, rect, paper);\n            }\n          } catch (err) {\n            console.warn('[impeccable] shader resume failed:', err);\n          }\n        })();\n      }\n    }\n    return true;\n  }\n\n  //\n  // Global bar (always visible at bottom)\n  //\n\n  let globalBarEl = null;\n  let globalBarBrandEl = null;\n  let agentPollTooltipEl = null;\n  let agentPollingConnected = false;\n  let agentStatusMessage = null;\n  let agentStatusPollTimer = null;\n  let steerFocusSuspended = false;","sourceCodeStart":9220,"sourceCodeEnd":9256,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f88b2837a7d7c3182e46307bbbb091a1ed547571/skill/scripts/live-browser.js#L9220-L9256","documentation":"When a GENERATING session resumes (e.g. after a page reload), the client asynchronously re-captures the target element (or insert placeholder) to restart the shader overlay at the right coordinates. Any throw inside that async block — element gone after reload, capture failure of the same class as the main path — is logged as 'shader resume failed:' and swallowed; resume itself succeeds, only the overlay is missing.","triggerScenarios":"The target element was removed or replaced by SSR/hydration during reload so getBoundingClientRect or captureElementToBlob fails; the element is display:none giving a zero rect (that case returns silently); modern-screenshot failure on the reloaded DOM.","commonSituations":"Page reload mid-generation where the app renders a different DOM; hydration replacing the captured node; element hidden behind the overlay at resume time.","solutions":["Cosmetic only — wait for the generation result; the flow does not need the overlay","Re-trigger generate if the visual anchor matters on the reloaded page","If overlays routinely fail to resume, ensure the target element has a stable selector across reloads"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const rect = shaderTarget?.getBoundingClientRect();\nif (!shaderTarget?.isConnected || !rect || rect.width === 0 || rect.height === 0) return; // no overlay on resume","typeGuard":null,"tryCatchPattern":"try { const { blob, paper } = await captureElementToBlob(shaderTarget, null, rect); if (blob && state === 'GENERATING') showShaderOverlay(shaderTarget, blob, rect, paper); } catch (err) { console.warn('shader resume failed:', err); } // resume continues regardless","preventionTips":["Give generate targets stable selectors so they survive reload/hydration","Check isConnected and non-zero rect before re-capturing on resume","Never block the resumed session on overlay success — it is purely visual"],"tags":["resume","shader-overlay","capture","race-condition"],"backgroundTag":"screenshot-capture-failed","analyzedSha":"f88b2837a7d7c3182e46307bbbb091a1ed547571","analyzedAt":"2026-08-18T04:58:36.608Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}