pbakaus/impeccable · info
[impeccable] shader resume failed:
Error message
[impeccable] shader resume failed:
What it means
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.
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
Defensive patterns
Strategy: fallback
Validate before calling
const rect = shaderTarget?.getBoundingClientRect(); if (!shaderTarget?.isConnected || !rect || rect.width === 0 || rect.height === 0) return; // no overlay on resume
Try / catch
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 Prevention
- 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
When it happens
Trigger: 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.
Common situations: Page reload mid-generation where the app renders a different DOM; hydration replacing the captured node; element hidden behind the overlay at resume time.
Related errors
- [impeccable] capture failed, proceeding without screenshot:
- [impeccable] shader bitmap decode failed:
- [impeccable] shader setup failed:
- No painted ancestor for Svelte shader proxy
- Selected element has no visible capture rect
AI-assisted analysis of pbakaus/impeccable@f2c7051853 (2026-08-18).
Data as JSON: /api/errors/87ba36df612777bb.
Report an issue: GitHub.
Appendix: source
Thrown at skill/scripts/live-browser.js:9715
origin: sessionOrigin || undefined,
insertPlaceholder: insertPlaceholderSnapshot || undefined,
pickedAnchor: pickedAnchorSnapshot || undefined,
pickedAnchorViewportTop: Number.isFinite(pickedAnchorViewportTop) ? pickedAnchorViewportTop : undefined,
pageHash: location.hash || undefined,
pageSearch: location.search || undefined,
});
}
function loadSession() {
const saved = sessionState.loadSession();
// localStorage is per-origin, and two projects routinely reuse the same
// localhost port. A saved session stamped with another project's appRoot
// is that project's leftover, never a session this server can complete;
// resuming it freezes the picker behind an unfinishable banner.
if (saved?.appRoot && APP_ROOT && saved.appRoot !== APP_ROOT) {
console.warn('[impeccable] Ignoring saved live session from another project (' + saved.appRoot + ').');
sessionState.clearSession();
return null;
}
return saved;
}
function clearSession() {
sessionState.clearSession();
}
/** Mark session as handled (accepted/discarded). The agent will clean up
* the source, but until it does the wrapper is still in the HTML. This
* prevents resumeSession from picking it up again after reload. */
function markSessionHandled() {
if (!currentSessionId) return;
sessionState.markHandled(currentSessionId);
}
function isSessionHandled(id) {
return sessionState.isHandled(id);View on GitHub (pinned to f2c7051853)