JuliusBrussee/caveman · error

${path} must be JSON data (got ${typeof value})

Error message

${path} must be JSON data (got ${typeof value})

What it means

Error "${path} must be JSON data (got ${typeof value})" thrown in JuliusBrussee/caveman.

Source

Thrown at packages/mastra/src/index.ts:755

    case "string":
      return JSON.stringify(value);
    case "boolean":
      return value ? "true" : "false";
    case "number":
      if (!Number.isFinite(value)) throw new Error(`${path} must be a finite number`);
      return JSON.stringify(value);
    case "object": {
      if (Array.isArray(value)) {
        return `[${value.map((item, i) => stableStringify(item, `${path}[${i}]`)).join(",")}]`;
      }
      if (!isPlainObject(value)) throw new Error(`${path} must be a plain object, array, or primitive`);
      const entries = Object.entries(value).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
      return `{${entries
        .map(([key, item]) => `${JSON.stringify(key)}:${stableStringify(item, `${path}.${key}`)}`)
        .join(",")}}`;
    }
    default:
      throw new Error(`${path} must be JSON data (got ${typeof value})`);
  }
}

// ---------------------------------------------------------------------------
// 5. Deep links
// ---------------------------------------------------------------------------

/**
 * Mastra Studio's documented default address. The dev server listens on 4111
 * (or `PORT`): https://mastra.ai/docs/studio/overview
 */
export const MASTRA_STUDIO_DEFAULT_BASE_URL = "http://localhost:4111";

export interface MastraStudioLinkOptions {
  /**
   * REQUIRED. Mastra documents a Studio Observability tab but not a per-trace
   * URL, so this package will not invent one. Supply the shape your Studio
   * build uses, with `{traceId}` (and optionally `{baseUrl}`) placeholders —

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Pass JSON-serializable data at the indicated path.

When it happens

Trigger: Thrown at packages/mastra/src/index.ts:755 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/00292ee0eeed458f. Report an issue: GitHub.