Skip to main content
Debug

Debug an error without shotgun changes

Give Gemini the error, the reproduction, and the relevant code, then ask for the most likely root cause, a minimal fix, and how to confirm it — before touching anything else.

Il prompt

Here is a bug. Symptom: [SYMPTOM]. Reproduction: [STEPS]. Relevant code: [CODE/FILES]. Identify the most likely root cause with reasoning, propose the minimal fix, and tell me how to confirm it works. Do not suggest unrelated refactors. If you are unsure, list what to check next.

Sostituisci le variabili

[SYMPTOM]

Exact error text or wrong behaviour.

[STEPS]

How to reproduce.

[CODE/FILES]

The smallest slice that contains the bug.

Quale modello usare

  • Gemini 3.1 ProRoot-cause reasoning over multiple files is stronger on Pro.

Input di esempio

  • [SYMPTOM] = "TypeError: cannot read property id of undefined on checkout".

Output di esempio

Pubblichiamo output di esempio solo da esecuzioni reali del modello. Questo template non è ancora stato testato formalmente, quindi non viene mostrato alcun output. Eseguilo tu stesso con l'input qui sopra.

Perché questa struttura funziona

  • Anchoring on reproduction keeps the model from guessing in the dark.
  • Banning unrelated refactors keeps the diff small and reviewable.

Errori comuni e soluzioni

It guesses without the real code.

Soluzione: Paste the actual failing function and stack trace.

Limiti noti

  • Confirm the fix by reproducing the bug first, then re-running.

Non affiliato né approvato da Google. Gemini, Nano Banana e Veo sono marchi di Google LLC.