Picture this: your PR passes every test locally, you push it, and two minutes later CI turns red — or worse, production crashes right after deploy.
"Works on my machine" is rarely a mystery. It almost always means your laptop has hidden state that the server does not.
The mental model
Your laptop is a lived-in kitchen : half the ingredients are already on the counter (cached builds, global tools, .env.local , macOS defaults).
CI and production start from an empty kitchen . They only get what you explicitly wrote on the recipe — your git repo, your lockfile, and your config. Anything missing from the recipe breaks the dish.
The 6 usual suspects (and how to fix each)
1.…