> For the full index of Sherpa pages for agents, see https://www.withsherpa.ai/llms.txt

URL: https://www.withsherpa.ai/docs/preview-build-failed
Title: A preview build failed | Sherpa Docs
Description: Get a preview working again when the build did not finish.

[Docs](https://www.withsherpa.ai/docs) Troubleshooting

# A preview build failed

Get a preview working again when the build did not finish.

A failed preview build is not an emergency. Your live website has not changed, and your agent can read the build log and fix the cause itself. This page covers the one prompt that sorts out most failures and what to try when it does not.

## See it in action

Ask your agent this.

> The preview failed to build. Read the build log, tell me in plain words what went wrong, fix it and build again.

It answers with something like this.

A page was importing a component that no longer exists. I fixed the import and the preview builds now.

## What happens

1. Your agent reads the end of the build log.

2. It fixes the files that caused the error.

3. It builds the preview again and sends you the link.

## Good to know

### Your live site is fine

A failed preview does not touch the live website. A failed release does not either. The live site stays on its last good version.

### If it keeps failing

Ask your agent to explain the error in plain words and what it has tried. If the same error comes back twice, ask it to undo its last step and take a simpler approach.

### Content errors

If the change touches the CMS, ask your agent to check the content. A missing required field or a reference to a draft entry will stop a build.

## Common questions

### Did a failed preview break my live website?

No. A failed preview or a failed release does not touch the live site. It stays on its last good version.

### How do I fix a failed build?

Ask your agent. It reads the build log, fixes the files that caused the error and builds the preview again.

### What if it keeps failing?

Ask your agent to explain the error in plain words. If the same error comes back twice, ask it to undo its last step and take a simpler approach.

## Example prompts

Each one works as written in Claude or ChatGPT once Sherpa is connected. Swap in your own pages and dates.

### The request from the example

> The preview failed to build. Read the build log, tell me in plain words what went wrong, fix it and build again.

Asking for the cause in plain words means you learn what happened, and it makes your agent find the real problem before it tries a fix.

### The content check

> Check the CMS content in this change and fix anything invalid.

A missing field or a link to a draft entry is the most common reason a content change will not build.

### The step back

> Undo your last edit and try a simpler way.

When the same error comes back twice, a different approach beats a third attempt.

### The diagnosis

> What have you tried so far, and what is the real cause?

Makes your agent step back and reason before it edits again.

## For agents

Sherpa MCP tools for this job, in the order they are usually called. `get_preview_status`, `validate_cms`, `revert_files`, `edit_files`, `preview_change`. Work inside a change, and only call submit_change when the person asks to publish. A person presses Publish. Every tool is described in the [MCP reference](https://www.withsherpa.ai/docs/mcp-reference).

## Next

[**My change is not live** Find out why a change you made is not showing on your website.](https://www.withsherpa.ai/docs/change-not-live) [**A form stopped sending** Track down a form submission that did not arrive where you expected.](https://www.withsherpa.ai/docs/form-not-sending)
