pbakaus/impeccable · warning

[impeccable] Refusing to render empty variant cycling state:

Error message

[impeccable] Refusing to render empty variant cycling state:

What it means

Guard against mounting a variant cycler with zero variants. recoverEmptyCycling logs the reason and recovers: if the Svelte session matches, it resets it with a 'No variants were mounted' message; otherwise it runs full cleanup. Rendering would otherwise produce a stuck/empty UI.

Source

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

    pickerEl.style.opacity = '0';
    pickerEl.style.transform = 'scale(0.96) translateY(4px)';
    setTimeout(() => { if (pickerEl) pickerEl.style.display = 'none'; }, 180);
  }

  function ensureCyclingRenderable(reason) {
    if (arrivedVariants > 0) {
      if (visibleVariant < 1 || visibleVariant > arrivedVariants) visibleVariant = 1;
      return true;
    }
    recoverEmptyCycling(reason);
    return false;
  }

  function recoverEmptyCycling(reason) {
    if (recoveringEmptyCycling) return;
    recoveringEmptyCycling = true;
    try {
      console.warn('[impeccable] Refusing to render empty variant cycling state:', reason);
      const message = 'No variants were mounted. Please try again.';
      if (svelteComponentSession?.sessionId === currentSessionId) {
        resetSvelteComponentSession(currentSessionId, message);
        return;
      }
      cleanup();
      showToast(message, 5000);
    } finally {
      recoveringEmptyCycling = false;
    }
  }

  //
  // Params panel (per-variant coarse controls)
  //
  // Variants may declare a parameter manifest via a JSON attribute on the
  // variant wrapper:
  //

View on GitHub (pinned to 2bc2879276)

Solutions

  1. Fix the invalid/empty data-impeccable-params attribute so variants exist (see related JSON warning).
  2. Retry the generate action; transient mounting races recover on the next attempt.
  3. Reload the page if a framework re-render keeps wiping mounted variants.
  4. Check the logged `reason` argument — it names which empty condition triggered.

Example fix

// before: params attr missing/invalid => empty variants
<div data-impeccable-params="not json">
// after
<div data-impeccable-params="[{\"label\":\"A\"},{\"label\":\"B\"}]">
Defensive patterns

Strategy: validation

Validate before calling

function hasVariantsToCycle(state) {
  return Array.isArray(state?.variants) && state.variants.length > 0;
}
if (!hasVariantsToCycle(cyclingState)) recoverEmptyCycling('variants array empty');

Type guard

function isNonEmptyVariantList(v) {
  return Array.isArray(v) && v.length > 0 && v.every(x => x != null);
}

Try / catch

try {
  renderCyclingState(state);
} catch (err) {
  recoverEmptyCycling(err);
}

Prevention

When it happens

Trigger: Variant cycling state is about to render with an empty variant list (e.g. all candidate variants failed to mount, params parsed to [], or anchors missing); recoverEmptyCycling at skill/scripts/live-browser.js:3044 intercepts and warns.

Common situations: data-impeccable-params was invalid JSON so no variants were derived; every generated variant failed to inject into the page; a framework re-render wiped the mounted variants before cycling started.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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