---
title: "Analyse & Fix"
description: "When a preview fails, let AI diagnose the logs, explain the root cause, and apply the fix."
url: https://evonx.ai/docs/preview-and-debug/analyse-and-fix
locale: en
updated: 2026-09-04
---

# Analyse & Fix

When a preview fails, let AI diagnose the logs, explain the root cause, and apply the fix.

When a preview fails, you could read the stack trace — or you could press
**Analyse & Fix** and let the AI do it. It reads the failing preview's logs,
identifies the root cause, and comes back with a diagnosis and a proposed fix.

## Using it

1. In the [Preview Hub](/docs/preview-and-debug/preview-hub), open the preview
   that failed. Failed previews are marked clearly in the list.

2. Click **Analyse & Fix**. The AI receives the full log output — install, build,
   and runtime — along with knowledge of your project's code and recent changes.

3. Read the diagnosis. You get the cause in plain language ("the new appointment
   screen calls an API endpoint that was renamed in the last change") rather than
   a raw stack trace.

4. Approve the fix. The repair runs like any other change — applied, verified, and
   visible in a fresh preview. You confirm the preview boots and the flow works.

## What it's good at

The strongest cases are mechanical failures with their cause in the logs: build
errors, crashes at startup, missing configuration, schema/migration mismatches,
broken API calls between your app and its backend. For "it runs but behaves
wrong", a normal chat message describing the wrong behavior — ideally with an
[annotated preview](/docs/preview-and-debug/annotate-preview) — gives the AI more
to work with than logs alone.

> **Tip**
> Analyse & Fix is also a learning tool: each diagnosis names the failing part of
> your stack in context. Business owners who read them for a few weeks start
> recognizing their app's anatomy — useful vocabulary for sharper
> [prompts](/docs/evolve/effective-prompting).

## If the fix doesn't take

Some failures have compound causes. If the preview fails again after a fix, run
Analyse & Fix again — the new logs reflect the new state — or reply in the thread
with anything you know that the logs don't show ("this started after we imported
the customer CSV").

## Related

- [Reading preview logs](/docs/preview-and-debug/reading-logs) — what the AI reads,
  if you want to follow along.
- [Troubleshoot previews](/docs/preview-and-debug/troubleshoot-previews) —
  failures you can resolve without a fix cycle.
