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?
9 answers
It might be a difference between pnpm and npm lockfiles. Check the deployment logs first.
lol environment variables are truly the standard go-to
If it works fine locally, you should start getting worried. That’s a normal sign.
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.
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 ㅠㅠ
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...
Isn't that outdated? These days, if you use a secrets manager, those kinds of mistakes hardly ever happen.
The real culprit seems to be less about environment differences and more about that confidence from 'running it 100 times locally' lol
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.