PromptDev

Debug an error message

Paste an error and what you were doing — get ranked likely causes with a check for each, instead of one confident guess.

Last updated

Fill in the blanks

Assembled in your browser — nothing you type is stored or sent anywhere.

Your prompt

Help me debug this error. Context: running npm run build after upgrading Node from 18 to 20 on Windows. First, translate what the error literally says in one plain sentence. Then list the most likely causes RANKED by probability given my context — for each: why it fits, and the quickest command or check to confirm or rule it out. Do not jump to a fix for cause #1 as if it were certain. If the error alone cannot distinguish the causes, tell me exactly what extra information would. Error: [paste the complete error, including the stack trace]

Model-agnostic — works in Claude, ChatGPT, Gemini or any AI chat.

Why this prompt works

  • →Ranked-causes-with-checks matches how debugging actually works; a single confident answer is wrong often enough to cost more time than it saves.
  • →"Translate what it literally says" first catches the surprising share of errors that answer themselves once read slowly.
  • →Asking what extra information would distinguish causes turns a dead end into the next concrete step instead of a shrug.

Part by part

translate what the error literally says in one plain sentence
Literal meaning first. A surprising share of debugging time is spent not knowing what the message is claiming, before any question of cause.
RANKED by probability given my context
Ranking rather than listing, weighted by your situation. An unordered set of possible causes is the same as no answer when you have to pick where to look.
the quickest command or check to confirm or rule it out
One diagnostic per hypothesis, so the list becomes a plan rather than a set of possibilities.
Do not jump to a fix for cause #1 as if it were certain
The default behaviour is to offer a fix immediately, and a fix applied before a check is how debugging turns into guesswork.
tell me exactly what extra information would
When the error genuinely cannot distinguish the causes, saying which log or flag would is more useful than a confident guess.

Common mistakes

  • How do I fix this error?

    Produces the most common fix for that message regardless of your situation. It works often enough to be worth trying and it teaches you nothing about why, so the next occurrence starts from zero.

  • Pasting the error with no context.

    Ranking by probability requires knowing your stack, what changed, and when it started. Without those the ranking is a generic frequency ordering that ignores the most informative signal you have.

  • What's wrong with my code?

    Invites a review of the whole file rather than an explanation of the failure. The error is the specific evidence you have, and starting anywhere else discards it.

Questions

Why translate the message first?

Because error text is written for the implementer, not the reader. Knowing that a message means the socket was already bound rather than the port is invalid changes which causes are even plausible.

What context is worth including?

What changed most recently, whether it is intermittent, and whether it happens in one environment or all of them. Those three eliminate more hypotheses than the stack trace usually does.

Why not just apply the first fix?

Because if it works you have learned nothing, and if it does not you have added a change to debug alongside the original problem. One check before one fix is faster in aggregate.

What if the message is truncated or generic?

Say so, and ask what would produce a better one — a verbose flag, a log level, a stack trace. A generic message is frequently a configuration problem in the logging rather than a limit of the tool.

Related in Prompts