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.
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.