That magic where it only blows up after deployment

Runs fine 100 times locally

Why does it blow up only after deployment lol

Lost 30 minutes again today because I forgot a single environment variable. We've all been there, right?

by 월급루팡184

9 answers

It might be a difference between pnpm and npm lockfiles. Check the deployment logs first.

by 취준생김씨173 · ▲0

lol environment variables are truly the standard go-to

by 프롬프트장인365 · ▲0

If it works fine locally, you should start getting worried. That’s a normal sign.

by 코딩하는곰306 · ▲0

If it was just a missing environment variable, consider yourself lucky... I once lost half a day because an old library version that was only installed locally caused an import error only in prod. There wasn't a single version pin in requirements.txt. Since then, I've switched to matching my local environment with docker-compose and running tests in CI by building the actual image. It's annoying, but in the end it's the fastest.

by 취준생김씨695 · ▲0

If it only took 30 minutes, you got off easy. Mine blew up at 6 PM on Friday, so I had to give up my weekend ㅠㅠ

by 디지털노마드226 · ▲0

Well, if it's just environment variables, isn't it something that can be solved by simply adding a dotenv check script? I don't understand wasting 30 minutes every time. Leaving omissions up to luck is a bit...

by 디지털노마드610 · ▲0

Isn't that outdated? These days, if you use a secrets manager, those kinds of mistakes hardly ever happen.

by 주말개발자138 · ▲0

The real culprit seems to be less about environment differences and more about that confidence from 'running it 100 times locally' lol

by 뉴비탈출629 · ▲0

I completely agree. I also used to cause a lot of trouble for my teammates because I had a habit of not keeping .env.example up to date. Now we've set a rule to commit the example and README together whenever we add a new environment variable. It's a small thing, but it definitely works.

by 지나가던행인790 · ▲0