Bug Explainer and Fixer
Paste an error message and the relevant code to get the likely cause, a fix, and how to confirm it.
The prompt
I have a bug. Help me find the cause step by step.
Language / framework: [LANGUAGE AND VERSION]
What I expected: [EXPECTED BEHAVIOR]
What happened: [ACTUAL BEHAVIOR]
Error message (full text): [ERROR]
Relevant code: [CODE]
Please:
1. Explain in plain words what the error means
2. List the 3 most likely causes, most likely first
3. Give a minimal fix for the most likely cause
4. Tell me one quick check to confirm the cause before changing code
If you need more information, ask me instead of guessing.
How to use it
- Paste the full error text, including the file and line number.
- Include the version of the language or library. Many bugs are version-specific.
- Do the quick check from step 4 before applying the fix.
Tips
- Share the smallest code that reproduces the problem. It is easier for you and the model to reason about.
What to expect
A 'cannot read properties of undefined' error is explained as a missing value from an API call, with a guard clause fix and a console check.
AI answers can contain mistakes. Check facts, numbers and any code before relying on them, and do not paste private or confidential information into AI tools.