Skip to content

Navid's Blog

Ideas, Experiments, and Lessons Learned

Menu
Menu

I Spent 3 Hours Debugging — It Was a Typo

Posted on April 17, 2026 by Navid

Three hours. That’s how long I stared at my screen, questioning my career choices, doubting everything I knew about programming. And you know what the problem was? A single character. A missing letter. A typo.

The Scene

It was a Friday afternoon. Simple task — fetch some data from an API, process it, save to database. Nothing fancy. I’ve done this a hundred times.

The code looked clean. Logics was solid. I ran it. Nothing happened. No error, no data, just silence.

The Spiral

First hour: I checked the API response. It was returning data correctly. OK, so the problem is in my code.

Second hour: I added console.log everywhere. Tracing every variable. Everything looked fine up until the save function.

Third hour: I started questioning the database connection. Restarted the server. Checked environment variables. Called my colleague to look at it. He couldn’t find anything either.

The Discovery

Then I saw it. There it was. Right in front of me the whole time.

Instead of userId, I typed userID in one place.

The database field was userId (camelCase). My code was sending userID. No error because JavaScript doesn’t care. It just ignored the mismatch silently.

The Lesson

Here’s what I learned that day:

  • Silent failures are the worst. No crash, no warning, just nothing. Wish the code had thrown an error instead.
  • TypeScript would have caught this. Actually, it probably would have. I was in a hurry and skipped the types. Never again.
  • Take a break. I was stuck for 3 hours, but after a 10-minute walk, I spotted it in 30 seconds.

What I’d Do Different

Now I follow these rules:

  1. Always use TypeScript for anything beyond a simple script
  2. Add validation early — check that keys exist before processing
  3. Walk away when stuck. Coffee, walk, anything. The brain needs reset.

So yeah. Three hours for a typo. It happens. We’re all human.

Categories

  • AI Experiments
  • Coding
  • Debugging Stories
  • Hot Takes
  • Ideas
  • Lessons Learned
  • Project Management
  • Uncategorized
  • Vibe Coding

Recent Posts

  • I Spent 3 Hours Debugging — It Was a Typo
  • I Spent 3 Hours on a Bug That Was a One-Line Fix
  • The Time I Accidentally Deleted Our Production Database
  • I Accidentally Deleted Production Data at 2 AM — Here’s What Saved Me
  • How I Found the Memory Leak That Was Killing Our Production Server