.env.local.production | 2026 |
It was the naming convention. .env.local.production was a lie. A file cannot be both local and production. It cannot serve two masters. It was a ghost in the machine, born from a quick Slack reply, given power by an overeager script, and waiting for a sleepy Friday night to strike.
export default function handler(req, res) res.status(200).json( nodeEnv: process.env.NODE_ENV, customVar: process.env.MY_CUSTOM_VAR, // Warning: Do not do this in real production allEnv: process.env ); .env.local.production
✅ .env.production.local has the highest priority when NODE_ENV=production . It was the naming convention