Explain an error message and how to fix it

Translates a stack trace into plain English, names the most likely cause in your code, and gives the smallest fix to try first.

Prompt, 3 blanks to fill
Help me understand and fix this error.

Environment: {{ENVIRONMENT}}

Error:
```
{{ERROR}}
```

Relevant code:
```
{{CODE}}
```

Answer in this order:
1. What the error means, in one or two plain sentences.
2. The most likely cause in my code. Quote the exact line.
3. The smallest fix to try first, as a code snippet.
4. Two other possible causes if the first fix does not work, and how to check each.

If you need information I did not give you, say what it is instead of guessing. Do not invent library functions.

Example output

What it means: you called .map() on something that is undefined. Most likely cause: `user.orders` is missing when the API returns a guest user (line 18). Fix to try first: `(user.orders ?? []).map(...)`

How to use

Paste the full error including the stack trace, plus the function it points to. Put your language, framework and versions in ENVIRONMENT, for example "Node 22, Next.js 15".

Why it works

Ordering the answer from meaning to cause to fix makes the model reason through the problem before it writes code. The rule against invented functions targets the most common failure in debugging answers.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close