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.

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

Remplacez les variables

[SYMPTOM]

Exact error text or wrong behaviour.

[STEPS]

How to reproduce.

[CODE/FILES]

The smallest slice that contains the bug.

Quel modèle utiliser

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

Exemple d'entrée

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

Exemple de sortie

Nous ne publions que des exemples de sorties issus d'exécutions réelles sur un modèle. Ce modèle n'a pas encore été formellement testé, aucune sortie n'est donc affichée. Exécutez-le vous-même avec l'entrée ci-dessus.

Pourquoi cette structure fonctionne

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

Échecs courants et correctifs

It guesses without the real code.

Correctif : Paste the actual failing function and stack trace.

Limites connues

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

Non affiliée à Google ni soutenue par lui. Gemini, Nano Banana et Veo sont des marques de Google LLC.