thedotmack/claude-mem · info

Onboarding explainer not available

Error message

Onboarding explainer not available

What it means

handleOnboardingExplainer serves a cached onboarding markdown document. If the module-level cache cachedOnboardingExplainer is still null (the explainer content was never loaded/generated), the endpoint replies 404 'Onboarding explainer not available' instead of serving the markdown.

Solutions

  1. Retry the request after the worker finishes initializing (the cache is populated at startup)
  2. Check worker startup logs for explainer generation/loading failures
  3. Verify the onboarding markdown asset exists in the installation; reinstall/repair if missing
  4. Fall back to the shipped docs (docs.claude-mem.ai) if the endpoint remains 404

Example fix

// before
const res = await fetch('http://localhost:37777/api/onboarding-explainer'); // 404 right after start
// after
await waitForWorkerReady(); // poll a health endpoint first
const res = await fetch('http://localhost:37777/api/onboarding-explainer');
Defensive patterns

Strategy: retry

Validate before calling

const res = await fetch('http://localhost:37777/api/onboarding-explainer');
if (res.status === 404) console.warn('Explainer not cached yet; retry after worker init');

Try / catch

async function getExplainer(retries = 5) {
  for (let i = 0; i < retries; i++) {
    const res = await fetch('http://localhost:37777/api/onboarding-explainer');
    if (res.ok) return res.text();
    if (res.status === 404) await new Promise(r => setTimeout(r, 1000 * (i + 1)));
    else res.body?.cancel();
  }
  return null; // fall back to bundled docs
}

Prevention

When it happens

Trigger: GET the onboarding explainer route before the explainer content has been loaded/cached in the worker process, or when explainer generation failed or is unavailable in this build/environment.

Common situations: Requesting the explainer immediately after worker startup before initialization populates the cache; a build or install where the onboarding markdown asset is missing; explainer generation failed silently at startup.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of thedotmack/claude-mem@d8bc9755e7 (2026-09-17). Data as JSON: /api/errors/82cf26f1027e7806. Report an issue: GitHub.

Appendix: source

Thrown at src/services/worker/http/routes/SearchRoutes.ts:442

    }

    res.json({ context: lines.join('\n'), count: observations.length });
  });

  private queryWithPlatformSource(req: Request): Record<string, any> {
    const platformSource = this.getOptionalPlatformSourceFromRequest(req);
    if (!platformSource) {
      return req.query as Record<string, any>;
    }
    return {
      ...(req.query as Record<string, any>),
      platformSource,
    };
  }

  private handleOnboardingExplainer = this.wrapHandler((_req: Request, res: Response): void => {
    if (cachedOnboardingExplainer === null) {
      res.status(404).json({ error: 'Onboarding explainer not available' });
      return;
    }
    res.setHeader('Content-Type', 'text/markdown; charset=utf-8');
    res.send(cachedOnboardingExplainer);
  });

  private handleGetTimelineByQuery = this.wrapHandler(async (req: Request, res: Response): Promise<void> => {
    const result = await this.searchManager.getTimelineByQuery(this.queryWithPlatformSource(req));
    res.json(result);
  });
}

View on GitHub (pinned to d8bc9755e7)