thedotmack/claude-mem · error

Failed to load settings (${res.status})

Error message

Failed to load settings (${res.status})

What it means

Error "Failed to load settings (${res.status})" thrown in thedotmack/claude-mem.

Source

Thrown at src/ui/viewer/hooks/useSettings.ts:16

import { useState, useEffect } from 'react';
import { Settings } from '../types';
import { DEFAULT_SETTINGS } from '../constants/settings';
import { API_ENDPOINTS } from '../constants/api';
import { TIMING } from '../constants/timing';

export function useSettings() {
  const [settings, setSettings] = useState<Settings>(DEFAULT_SETTINGS);
  const [isSaving, setIsSaving] = useState(false);
  const [saveStatus, setSaveStatus] = useState('');

  useEffect(() => {
    fetch(API_ENDPOINTS.SETTINGS)
      .then(async res => {
        if (!res.ok) {
          throw new Error(`Failed to load settings (${res.status})`);
        }
        return res.json();
      })
      .then(data => {
        setSettings({ ...DEFAULT_SETTINGS, ...data });
      })
      .catch(error => {
        console.error('Failed to load settings:', error);
      });
  }, []);

  const submitSettings = async (newSettings: Settings) => {
    const response = await fetch(API_ENDPOINTS.SETTINGS, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(newSettings)
    });

View on GitHub (pinned to d768ba3643)

Solutions

  1. Ensure the worker is running and serving the settings endpoint; reload the viewer after the worker is up.
  2. Check the HTTP status in the message: 5xx means worker-side failure (see worker logs), 4xx means a bad request or auth issue.

When it happens

Trigger: Fires in the viewer UI when GET of the settings endpoint returns a non-2xx status, typically because the worker is down, the port in settings.json is stale, or the settings file is unreadable server-side. Guard at src/ui/viewer/hooks/useSettings.ts:16 surfaces the HTTP status instead of silently showing defaults.

Common situations: See trigger scenarios.


AI-assisted analysis of thedotmack/claude-mem@d768ba3643 (2026-08-12). Data as JSON: /api/errors/cf35ddd728b1ae24. Report an issue: GitHub.