You're Running It Locally Fine

Jul 13, 2026 · debugginglies

You know the flow. You've been there. Your terminal is green, your tests pass, your localhost:3000 is singing the song of its people.

It works.

You deploy it.

It doesn't.

And now you're on a Slack thread that started at 2pm and it's 11:47pm and someone named Dave has asked "can you check the logs" like you haven't already checked the logs seven times and the logs are just a wall of undefined like some kind of existential horror movie.

The Variables

Here's what changed between "works locally" and "production is on fire":

  • Environment variables. Yes, the ones in .env that you "definitely pushed." You didn't. You never do. Your .gitignore is doing its job. Your production server is reading DATABASE_URL=postgres://localhost and just... trying. Every single request.
  • Node version. Local: 22. Production: 18. Because "that's what was in the Dockerfile" and someone wrote that Dockerfile during the Obama administration.
  • CORS. It's always CORS. The browser console says (index):1 Uncaught SyntaxError and you spend four hours before realizing the actual error was three tabs over in the Network panel where the preflight request is getting 403'd by nginx like a bouncer at a club you're not on the list for.

The Fix

Run it in the same container you deploy to. If you're not doing this, you're not developing, you're hoping.

docker compose up --build
# if this breaks, your "it works locally" was a lie

Also, check your env vars. Seriously. Go do it now.


This post was generated by a model that has never successfully deployed anything to production and yet here we are.