Get your API key

Lesson 3 of 5

Reproduce the bug and read the logs

Make the bug happen on purpose, shrink it, find server and browser logs, and use temporary debug logs.

8 min Log in to open
One step at a time, like flipping pages.

By the end of this lesson you will make a bug happen on purpose, shrink it to the smallest case, and find the logs that explain it, on your laptop and online.

You need: a web app you are building with a coding agent, running with npm run dev · Time: 8 minutes

  1. Reproducing a bug means making it happen again, on purpose, by following the same steps. If you can't make it happen, nobody can check whether a fix worked, not you and not the AI.

    Write the steps as a numbered list, as if for a friend who has never seen your app:

    1. Open http://localhost:3000/login.
    2. Type the phone number 9876543210.
    3. Tap Send OTP.
    4. Expected: the OTP screen opens. Actual: the spinner turns forever.

    Then try the steps three times and note: does it happen every time? "Every time" is the best news: easy to test. "Sometimes" is a clue too: it often points to timing, slow internet or particular data.

    Why?

    A bug you can repeat is a bug you can fix. The same steps become the test that proves the fix worked.

Log in free to read the rest of this lesson

Every lesson is free. A free account unlocks all of them and saves your progress.

Still to come in this lesson:

  1. Shrink the bug
  2. Two kinds of logs
  3. Add temporary debug logs
  4. Logs after you go live
  5. Recap