tinyhumansai/openhuman · error

[MeshGradient] init failed, gradient disabled:

Error message

[MeshGradient] init failed, gradient disabled:

What it means

Caught bootstrap failure of the MeshGradient visual component: init() chains initGradientColors, initMesh, resize and frame tracking inside one try; any throw (missing canvas context, invalid gradient config, detached DOM) is caught, warned, and the gradient is disabled for the session — the app continues without the animated background.

Source

Thrown at app/src/lib/meshGradient.js:724

    ((this.isGradientLegendVisible = !1),
      document.body && document.body.classList.remove('isGradientLegendVisible'));
  }
  init() {
    if (this.destroyed) {
      console.debug('[MeshGradient] init skipped — gradient already disconnected');
      return;
    }
    try {
      (this.initGradientColors(),
        this.initMesh(),
        this.resize(),
        // Track this first frame like every other one: `disconnect()` only
        // cancels `animateRaf`, so leaving this handle unstored let the opening
        // frame outlive teardown — the exact leak this change set closes.
        (this.animateRaf = requestAnimationFrame(this.animate)),
        window.addEventListener('resize', this.resize));
    } catch (err) {
      console.warn('[MeshGradient] init failed, gradient disabled:', err);
    }
  }
  /*
   * Waiting for the css variables to become available, usually on page load before we can continue.
   * Using default colors assigned below if no variables have been found after maxCssVarRetries
   */
  waitForCssVars() {
    if (this.destroyed) {
      console.debug('[MeshGradient] waitForCssVars stopped — gradient disconnected');
      return;
    }
    if (
      this.computedCanvasStyle &&
      -1 !== this.computedCanvasStyle.getPropertyValue('--gradient-color-1').indexOf('#')
    )
      (this.init(), this.addIsLoadedClass());
    else {
      if (((this.cssVarRetries += 1), this.cssVarRetries > this.maxCssVarRetries)) {

View on GitHub (pinned to 7491200858)

Solutions

  1. Accept degradation — the gradient is cosmetic and non-load-bearing
  2. Check for a missing 2D canvas context or unsupported browser API as the usual cause
  3. Ensure disconnect()/destroy flags are honored before re-init to avoid repeat failures
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at app/src/lib/meshGradient.js:724 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/a845b69e8773b995. Report an issue: GitHub.