L16 · Build & preview · 4 min

How to read an error message

In one sentence

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.

Think of it like this

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 Definitionerror messageWhat a program says when something fails. Its first line usually says what; the rest says where.Open in the glossary →. 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 DefinitionfileA named piece of content saved on your computer, like a document, an image or a piece of code.Open in the glossary → 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 Definitionstack traceThe list of steps that led to an error. Useful for your agent; never shown to your users.Open in the glossary →: the reverse trail of steps your app took before stopping. You don't need to memorize or decode every line—your Definitioncoding agentAn AI that works in your project folder: it reads files, writes code and runs commands, with your permission.Open in the glossary → 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 DefinitionsecretAnything that opens your accounts: API keys, passwords, tokens. Kept only in Vercel and `.env.local`.Open in the glossary →, password or DefinitionAPI keyA password your app uses with another service. Whoever has it can spend your money.Open in the glossary → is visible; the agent can read local DefinitionlogYour app's diary: one line per event. When something breaks, the logs say what happened.Open in the glossary → files itself.

1 · First lineWhat went wrongExample: `TypeError: Cannot read properties of undefined`. Names the kind of failure.
2 · File : lineWhere it happenedExample: `app/recipes/page.tsx:24:12`. Points to file `page.tsx`, line 24, column 12.
3 · Stack traceHow it got thereLines starting with `at …` trace the call chain so your agent can find the root cause.
FIG. 1 · Anatomy of an error message: the first line says what failed, the file and line number say where, and the stack trace shows the steps that led there.

What it looks like 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

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.

Quick check · 1 question

In an error message showing `app/page.tsx:18:5`, what do `18:5` mean?

Go deeper

Next lessonLogs: your app's diary (and where to find them)

Last reviewed Nov 8, 2026