pbakaus/impeccable · warning

[impeccable] capture failed, proceeding without screenshot:

Error message

[impeccable] capture failed, proceeding without screenshot:

What it means

Before dispatching a generate/steer event, the client captures the target element to a PNG blob via captureElementToBlob. If that capture throws (modern-screenshot failure, tainted canvas, layout mid-transition), the error is logged as 'capture failed, proceeding without screenshot:' and the flow continues without the image: non-annotated events were already sent before capture, annotated ones are sent afterwards minus the screenshotPath.

Solutions

  1. Check the request still succeeded — the event goes through without the screenshot
  2. Retrigger the generate to get a screenshot-backed run if visual anchoring mattered
  3. Serve images/fonts with permissive CORS so the canvas is not tainted
Defensive patterns

Strategy: fallback

Validate before calling

if (!el.isConnected) { sendWithoutScreenshot(); return; } // capture is pointless on detached elements

Try / catch

try { ({ blob, paper } = await captureElementToBlob(el, snapshot, rect)); } catch (err) { console.warn('capture failed', err); } // event still dispatched without screenshotPath

Prevention

When it happens

Trigger: modern-screenshot throws on the element (foreignObject-hostile content, cross-origin images without CORS, fonts still loading); capture racing a hot-reload remount of the target; capturing during page teardown.

Common situations: Dev-server hot reload swaps the element mid-capture; target contains cross-origin <img> without CORS headers; heavy pages where the rasterizer times out or OOMs.

Related errors


AI-assisted analysis of pbakaus/impeccable@f2c7051853 (2026-08-18). Data as JSON: /api/errors/c1380f587c3db74d. Report an issue: GitHub.

Appendix: source

Thrown at skill/scripts/live-browser.js:8507

    const parts = m[1].split(',').map((p) => p.trim());
    if (parts.length === 4) return parseFloat(parts[3]) === 0;
    return false;
  }

  // modern-screenshot force-sets `background-color: X !important` on the
  // cloned root whenever `backgroundColor` is passed, clobbering the
  // element's own background. So we only pass it when the element is
  // genuinely transparent (no own color, no own image) - in that case
  // we resolve up the DOM to the nearest opaque ancestor so the capture
  // sits on the page's real background instead of rendering black.
  function resolveCanvasBackground(el) {
    const own = getComputedStyle(el);
    if (!isTransparentColor(own.backgroundColor)) return null;
    if (own.backgroundImage && own.backgroundImage !== 'none') return null;
    let node = el.parentElement;
    while (node) {
      const cs = getComputedStyle(node);
      if (!isTransparentColor(cs.backgroundColor)) return cs.backgroundColor;
      node = node.parentElement;
    }
    // The walk already passed through <body> and <html>; if they had been
    // opaque we would have returned. Falling through with the previous
    // `getComputedStyle(body).backgroundColor || …` chain is a trap: that
    // call returns the literal string `"rgba(0, 0, 0, 0)"` for a page that
    // never set its own bg, which is truthy and short-circuits the chain to
    // transparent-black - modern-screenshot then renders the capture on a
    // black canvas and the shader overlay flashes solid black during load.
    // The browser canvas defaults to white, so we do too.
    return '#ffffff';
  }

  function captureChromeNodes() {
    const nodes = [];
    const add = (node) => {
      if (!node || node === document.body || nodes.includes(node)) return;
      nodes.push(node);

View on GitHub (pinned to f2c7051853)