Hours of Debugging… All Because of This One Postman Mistake



This content originally appeared on DEV Community and was authored by Dorcas Nyamekye Quaye

Let me save you some time. I spent hours debugging my backend routes, thinking the problem was my code, only to find out it was something way simpler.

I was testing protected routes like:
GET /auth-user
PUT /update-profile

These routes required a valid JWT and expected a properly formatted request body (JSON). My backend was using:

app.use(express.json());

And inside my controller, I was accessing data from req.body.

Despite everything looking fine in the code, my request kept failing with errors like:

{
  "message": "Unauthorized: No user ID found"
}

Or worse, the route would hit, but the body would be undefined.

I retested token flow, reconfigured middlewares, re-checked routes and controllers. But nothing worked.

😫 The Real Issue? Postman Was Set to Text, Not JSON

Yup. That was it.
In Postman, under Body > raw, I had left it on Text.
So instead of sending:

{
  "fullName": "Dorcas Q",
  "email": "dorcas@gmail.com"
}

It was sending plain text.
The backend, expecting JSON, saw… nothing. req.body was undefined.

When I finally realized I had left it in raw > Text instead of raw > JSON, I was both satisfied and so annoyed with myself. 😅
Like “Seriously? That’s what caused all this pain?”

🔍The Lesson I Learnt
Sometimes the problem isn’t in your backend logic. It’s in the tools you’re using to test.
This reminded me how easy it is to overlook the simple things, especially when:

  • You’re reusing old tabs that default back to Text instead of JSON.
  • You’re testing authenticated endpoints, and your brain is fixated on JWT flows, headers, and controller logic.
  • You’re just so tired and have been debugging for hours (which I absolutely was).😁

Now? I no longer run a Postman test without double-checking that it’s set to raw > JSON.
And if you made the same mistake, please don’t beat yourself up. It happens. A lot more often than you’d think.

✅ Final Tip
Before you start debugging controllers, token logic, or anything complex:

  • Double-check your Postman body type.
  • Make sure it’s raw > JSON.

Save yourself hours cause I wish I had.

☺ Now Over to You
Have you ever been stuck for hours only to realize it was something tiny like this?
Let me know in the comments 👇


This content originally appeared on DEV Community and was authored by Dorcas Nyamekye Quaye