pbakaus/impeccable · warning

[impeccable] Svelte component reset cleanup failed:

Error message

[impeccable] Svelte component reset cleanup failed:

What it means

Same cleanup path as the abort variant, but fired when a Svelte component session is reset (e.g. after empty cycling state). The teardown/orphan removal threw; it is warned and the reset continues with overlay hiding, observer disconnects, and scroll-lock release.

Solutions

  1. Reload the page to clear stale session state.
  2. Re-run the generation; reset is recoverable and subsequent state is cleaned.
  3. Check devtools for duplicated or already-removed [data-impeccable-variants] nodes.
  4. If reproducible with a specific framework setup, file an issue with the fixture/stack.

Example fix

// before
try { teardownSvelteComponentSession(true); } catch (err) { console.warn(...); }
// after (idempotent teardown)
try { if (svelteComponentSession) teardownSvelteComponentSession(true); } catch (err) { console.warn(...); svelteComponentSession = null; }
Defensive patterns

Strategy: try-catch

Validate before calling

function sessionTeardownable(session) {
  return !!session && typeof session.sessionId === 'string' &&
    !!document.querySelector('[data-impeccable-variants="' + session.sessionId + '"]');
}

Try / catch

try {
  teardownSvelteComponentSession(true);
} catch (err) {
  console.warn('[impeccable] Svelte component reset cleanup failed:', err);
} finally {
  hideShaderOverlay();
  stopScrollLock();
}

Prevention

When it happens

Trigger: resetSvelteComponentSession invokes teardownSvelteComponentSession(true) or removes the orphan [data-impeccable-variants] node and it throws; caught at skill/scripts/live-browser.js:6170.

Common situations: Reset triggered by recoverEmptyCycling while the component session is half-torn-down; framework HMR swapped out the DOM node; session bookkeeping already cleared by an earlier abort.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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

Appendix: source

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

    if (details) showMountErrorCard(sessionId, details);
    else if (!mountErrorState) {
      showMountErrorCard(sessionId, { message: 'Variants could not be mounted. Retry, or ask the agent to republish.' });
    }
  }

  // Hard reset for the one case that is not a mount failure: a cycling state
  // with nothing to cycle. There is no variant to retry and no URL to report,
  // so the session really is over.
  function resetSvelteComponentSession(sessionId, message) {
    try {
      if (svelteComponentSession?.sessionId === sessionId) {
        teardownSvelteComponentSession(true);
      } else {
        const orphan = document.querySelector('[data-impeccable-variants="' + sessionId + '"]');
        if (orphan) orphan.remove();
      }
    } catch (err) {
      console.warn('[impeccable] Svelte component reset cleanup failed:', err);
    }
    hideShaderOverlay();
    if (variantObserver) { variantObserver.disconnect(); variantObserver = null; }
    if (pendingSvelteComponentRetryObserver) { pendingSvelteComponentRetryObserver.disconnect(); pendingSvelteComponentRetryObserver = null; }
    if (pendingVariantAnchorRetryObserver) { pendingVariantAnchorRetryObserver.disconnect(); pendingVariantAnchorRetryObserver = null; }
    stopScrollLock();
    removeVariantStateStylesheet();
    clearMountErrorCard();
    clearSession();
    clearHandled();
    resetSessionFileMeta();
    currentSessionId = null;
    parameterGenerationState = 'idle';
    sessionOrigin = null;
    editBadgeSuppressed = false;
    parameterReadyAnnouncedSession = null;
    expectedVariants = 0;
    arrivedVariants = 0;

View on GitHub (pinned to f2c7051853)