moeru-ai/airi · error · Error

No output received from Replicate.

Error message

No output received from Replicate.

What it means

Thrown inside runGeneration after `await this.replicate!.run(model, { input })` returns a falsy value (null/undefined). The Replicate SDK resolved the prediction but produced no output payload at all, which the provider treats as a hard failure rather than an empty success. Distinct from [43] which handles an empty array, and [42] which handles an unrecognized shape.

Source

Thrown at apps/stage-tamagotchi/src/main/services/airi/widgets/providers/replicate.ts:137

    // We don't await the result here because the interface expects us to return an ArtistryJob immediately.
    // However, replicate.run() blocks until completion. We'll run it in the background and store the result.
    const jobId = request.extra?.internalJobId || Math.random().toString(36).slice(2)

    // Start generation asynchronously
    this.runGeneration(jobId, model, inputOptions)

    return { jobId, providerJobId: jobId }
  }

  private async runGeneration(jobId: string, model: `${string}/${string}`, input: object) {
    this.updateStatus(jobId, { status: 'running', actionLabel: 'Requesting cloud generation...' })

    try {
      const output = await this.replicate!.run(model, { input })

      if (!output) {
        throw new Error('No output received from Replicate.')
      }

      log.log(`[Replicate] Raw output type: ${typeof output}, isArray: ${Array.isArray(output)}`)

      // Replicate's run() can return a single string, an array of strings, or an array of FileUpload objects
      const items = Array.isArray(output) ? output : [output]
      if (items.length > 0) {
        const first = items[0]
        let imageUrl: string | undefined

        // Case 1: FileUpload object with .url() method (common in recent SDK versions)
        if (typeof first === 'object' && first !== null && 'url' in first && typeof (first as any).url === 'function') {
          imageUrl = (first as any).url().href
        }
        // Case 2: Object with url property as a string
        else if (typeof first === 'object' && first !== null && 'url' in first && typeof (first as any).url === 'string') {
          imageUrl = (first as any).url
        }

View on GitHub (pinned to 27111382b4)

Solutions

  1. Check the Replicate dashboard for the prediction status of the failing run (the SDK swallows the prediction id here — add logging of the raw prediction object).
  2. Confirm defaultModel / requested model slug still exists and is an image-output model on replicate.com.
  3. Retry once — null output is frequently transient on Replicate.
  4. If recurring, switch to a known-good model (e.g. black-forest-labs/flux-schnell) to isolate model vs platform.

Example fix

// before
const output = await this.replicate!.run(model, { input })
if (!output) {
  throw new Error('No output received from Replicate.')
}

// after
const output = await this.replicate!.run(model, { input })
if (!output) {
  throw new Error(`No output received from Replicate for model ${model}. Check prediction status.`)
}
Defensive patterns

Strategy: retry

Type guard

function hasReplicateOutput(output: unknown): output is NonNullable<typeof output> {
  return output != null
}

Try / catch

let output
for (let attempt = 0; attempt < 2; attempt++) {
  output = await provider.replicate.run(model, { input })
  if (output) break
  await new Promise(r => setTimeout(r, 1000))
}
if (!output) throw new Error('No output received from Replicate.')

Prevention

When it happens

Trigger: Replicate returns a resolved prediction whose `output` field is null/undefined — can happen when the model errored server-side but still HTTP-200'd, when a model version was deprecated mid-run, or when rate limiting caused a degenerate response.

Common situations: Model `owner/model` slug was retired or renamed; prediction succeeded but the model wrote no output file; transient Replicate platform incident; using a text model slug on an image input path.

Related errors


AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12). Data as JSON: /api/errors/bcd07dba22614f9c. Report an issue: GitHub.