# How to read an error message

> An error message is not a scolding; it is a helpful clue with three parts: the first line says what failed, the file name and line number point to where it happened, and the stack trace lists the steps that led there so your agent can fix it.

## Analogy

Think of a smoke detector that doesn't just beep, but prints a receipt saying: “Toast burned — Kitchen, toaster slot 2 — started after the timer was set to 9.” Once you know how to glance at the receipt, red text stops feeling scary.

## How it works

When something breaks during development, your computer shows an error-message. Even if it looks like a wall of technical text, you only need to recognize three parts: **what** went wrong, **where** it happened, and the **trail** of steps that led there.

The **first line** tells you **what** failed, such as `TypeError: Cannot read properties of undefined (reading 'title')` (the app tried to read `.title` on something that was empty). Right below it, a file path with two numbers separated by colons—like `app/recipes/page.tsx:24:12`—tells you **where**: line `24`, character `12` of that file.

The lines starting with `at …` underneath form the stack-trace: the reverse trail of steps your app took before stopping. You don't need to memorize or decode every line—your coding-agent reads stack traces fluently and uses them to pinpoint the exact cause.

To report a problem well, tell your agent three plain things—what you did, what you expected, and what happened instead—and include the exact error text or a screenshot. Before you paste or attach anything, always check that no secret, password or api-key is visible; the agent can read local log files itself.

## In your project

When an error pops up on `localhost:3000` or in the terminal, copy the message (making sure no keys or passwords are included) and tell your agent what you clicked right before it happened. Your agent will explain the error in one plain sentence before fixing it.

## Copy for your agent

```text
I clicked [button/link], expected [what should happen], and got this error instead: [paste error without any secrets]. Explain in plain words what the first line and file:line mean, then find the cause.
```

---
Source: [Agentic Makers](https://agenticmakers.app/en/learn/how-to-read-an-error-message) · License: CC BY 4.0
