EN
My account

Your privacy, your call. No advertising cookies. May we count your visit in aggregate (Cloudflare, no cookies) and remember where you came from? If you reject, we won’t measure your visit. · Cookies · Privacy

Privacy settings

Choose what we measure and what we keep in this browser. We never sell or share your data.

Essential

Remember your theme, language, saved items and this choice. Without them the site cannot work the way you ask.

Always on

Keeps the source of your first and latest visit for 90 days (utm parameters and referring site). It only leaves your browser if you subscribe to the newsletter.

Cloudflare Web Analytics counts visits in aggregate: page, referring site, country, browser and load times. No cookies, no identifiers and no profiling; nothing is stored in your browser. It only loads if you accept it. If you reject it or switch it off, it does not load (or stops loading from the next page) and we do not count your Telegram clicks either.

Cookies · Privacy

Work · Professional prompt

Debug an error from its message

Professional structure: role, context, objective, details, steps, format, criteria and self-check. Designed for better results, not guaranteed ones: always review the answer.

Never use real personal data. If you need to, run it through the data cleaner.

Fill in the blanks
## Role
Act as a developer skilled in methodical debugging.

## Context
My program fails and I have the error message, but I do not know why.

## Objective
Find the most likely cause and a verified fix.

## Details (fill in what is in square brackets)
- [full error message]
- [related code snippet]
- [environment: language, versions, system]
- [what changed before it failed]

## Step-by-step instructions
1. Explain in plain language what the error says.
2. Put forward three to five hypotheses ranked by likelihood.
3. For each one, propose a quick test to confirm or rule it out.
4. Give the fix for the most likely hypothesis.

## Output format
Explanation, hypotheses table (cause, test, expected result) and the fix in a code block.

## Quality criteria
- It does not treat a cause as certain without evidence.
- The tests are quick to run.
- The fix does not hide the error with an empty try/catch.

## Self-check
Before answering, check every quality criterion. If information is missing, ask me instead of making it up, and at the end state what you have assumed.

The link opens the empty template: what you type is not included.

Objective

Find the most likely cause and a verified fix.

When to use it

This prompt is brilliant when you are staring at a cryptic stack trace and feel stuck in a loop of trial and error. It is most useful for logic bugs, dependency issues, or environment mismatches where the error message provides a starting point but not the solution. Avoid using this for architectural design problems or when the error message is completely missing, as the AI needs concrete data to work effectively. It helps you stay methodical rather than guessing blindly.

Worked example: input (fictional data)

[full error message]: Uncaught ReferenceError: pricingCalculator is not defined at Dashboard.js:142 [related code snippet]: const total = pricingCalculator(cartItems, discountCode); [environment: language, versions, system]: JavaScript (ES6+), React 18.2.0, Node 16.14.0, macOS Ventura. [what changed before it failed]: We refactored the utility file structure yesterday to move pricing functions into a new folder named /utils/pricing, but I updated the import paths in the main App file. The Dashboard component was supposedly untouched, so I am confused why it suddenly cannot see the function now.

Worked example: full response

The error message indicates that your Dashboard component is attempting to call pricingCalculator, but the JavaScript engine cannot find that function in the current scope. This usually happens when an import fails silently or the function was not exported correctly. Here are three possible causes ranked by likelihood: - Missing Export: The pricingCalculator function is not exported from the new file. - Incorrect Import Path: The Dashboard file is looking in the old location or a relative path that is now broken due to the refactor. - Circular Dependency: The new structure created a loop where files depend on each other, causing the function to be undefined at runtime. Proposed tests: - Check the /utils/pricing file to ensure the line starts with 'export const pricingCalculator'. - Add a console.log(pricingCalculator) inside Dashboard.js right before the failing line to see if it logs as undefined. - Temporarily hardcode a dummy function in Dashboard.js to see if the error moves or disappears. Fix for the most likely cause (Missing Export): Ensure your file /utils/pricing/index.js exports the function explicitly. If you are using named exports, check the import statement in Dashboard.js. // In /utils/pricing/index.js export const pricingCalculator = (items, code) => { ... } // In Dashboard.js import { pricingCalculator } from '../utils/pricing'; If you previously used a default export, ensure the import in Dashboard.js matches that pattern without curly braces.

Variants

Quick triage version

Simplify your response to focus only on the most probable cause. Skip the full ranking and multiple hypotheses. Just explain the error, provide one quick diagnostic test I can run immediately to verify the root cause, and then give the direct code fix. Keep the response concise and actionable for a busy developer.

Junior developer mentor

Adopt a patient, teaching-focused tone for a junior developer. Explain the underlying computer science concept behind why this error is happening rather than just fixing it. Break down the logic step-by-step so I can learn how to debug similar issues independently next time. Focus on best practices for preventing this specific error in the future.

Production outage focus

Treat this as a critical production outage. Prioritise stability and immediate mitigation over long-term structural changes. Provide the quickest 'hotfix' to get the system running again safely, then suggest a proper refactoring task for later. Ensure the fix does not introduce side effects or data corruption while under pressure.

Common mistakes

Related guide

General and assistant-specific tips

Tips by assistant

  • Claude: separate your data with tags such as <document>…</document>; Anthropic recommends this so it can tell instructions from content.
  • ChatGPT: open the result in Canvas to edit specific paragraphs without regenerating the whole text.

Getting the most out of it

  • Paste the prompt as is and only replace what is in [brackets].
  • If the answer does not fit, do not start over: ask for “shorter”, “more formal” or “as a table”.
  • Always review the result before using it: AI can get facts, dates or names wrong.

Before you paste it: quick checklist

  • Remove client names, amounts and internal data before pasting.
  • Say who the text is for and which tone you want.
  • Ask for a specific length: “120 words max” or “three bullet points”.
  • Read the result aloud and fix anything you wouldn’t say yourself.

How to adapt it to your assistant

The template works the same in ChatGPT, Gemini, Copilot or Claude because it only uses plain language. If your assistant supports fixed instructions (custom instructions, Gems or projects), you can store your preferred tone and format there and paste only the variable part. On a free plan, split long requests into two or three shorter messages.

See all Work prompts

More professional prompts

← All prompts

Found this prompt useful? A new one every Tuesday

Every Tuesday, 5 minutes: AI news with sources, a tool with its prompt and a guide. Free, with one-click unsubscribe. What is inside and a sample issue