NoObjectGeneratedError means the model responded but the response could not be turned into your schema. The useful detail is in the cause chain, not the top message.

import { NoObjectGeneratedError, Output, generateText } from 'ai';
import { z } from 'zod';

try {
  const { output } = await generateText({
    model: 'your-model-id',
    output: Output.object({ schema: z.object({ name: z.string() }) }),
    prompt: 'Generate a person.',
  });
} catch (error) {
  if (NoObjectGeneratedError.isInstance(error)) {
    console.error('cause:', error.cause); // JSONParseError or TypeValidationError
  }
}

What to know:
1. Always inspect error.cause. JSONParseError means the model emitted invalid JSON (often wrapped in markdown fences). TypeValidationError means valid JSON that violates your schema.
2. For fence-wrapped JSON, add extractJsonMiddleware via wrapLanguageModel. It strips code fences before parsing.
3. For schema violations, add .describe() to fields and simplify the schema. Deeply nested optional fields are where models go wrong.
4. Some providers need strict JSON schema mode. Check the provider docs for a strictJsonSchema-style option if validation fails repeatedly on one provider but works on another.
5. In v6+, generateObject/streamObject are deprecated; this error now comes from the output: Output.object path. Old handlers keyed on generateObject still apply, just update the call site.
6. Log the raw text (with recordOutputs telemetry or a quick debug run) before blaming the schema. Half the time the model answered in prose because the prompt was ambiguous.