Est.

A build-time env var that was set correctly everywhere except where it mattered

An environment variable was configured everywhere except the build stage that actually needed it.

Staff Writer · · 3 min read
Features · August 4, 2026 · 3 min read · 727 words

There's a particular kind of broken that feels fine from the outside. The dashboard is green. The deployment succeeded. Every config file shows exactly what you'd want to see. And yet every API-dependent feature in your app is silently doing nothing. This exact scenario plays out regularly in frontend deployments, and the reason it's so hard to catch is that every conventional check stops one layer too early.

Everything Looked Fine Because It Was Fine (Mostly)

Here's the setup. A frontend framework that inlines environment variables directly into the compiled client bundle at build time. That detail is load-bearing. Unlike a server-side process that resolves variables at runtime, a frontend build bakes them into static files during compilation. Whatever the build process had access to at that exact moment is what ends up in the bundle. Nothing gets added later.

The deployment used a multi-stage container build:

  • Stage one: a build container that compiles the frontend and produces a static artifact
  • Stage two: a runtime container that serves that artifact

The API key was in the hosting platform's dashboard. It was in the local .env file. It was in the CI config. Triple-confirmed, by every normal standard.

What it was not: explicitly passed as a build argument into stage one. The only stage that actually needed it.

The runtime container had full access to the key. The runtime container had zero use for it. The build container, which did all the work that mattered, ran without it. So the bundle that shipped had an empty string where the key should have been, and every feature that depended on the API just quietly stopped working.

Why It's So Easy to Miss

Each stage in a multi-stage build is its own isolated environment. Variables available to the CI runner, the host, or the runtime container are not automatically passed to every stage. You have to explicitly hand them over using build arguments. Skip that step and the stage runs without the variable. No error. No warning. The app compiles fine. The deployment succeeds. Monitoring stays green.

Frontend frameworks that inline variables typically substitute an empty value when a variable is absent during the build. They don't throw. They just quietly replace your key with nothing, and ship it.

The deeper issue is that config surfaces describe intent. They don't describe execution. The dashboard tells you what was declared. The .env tells you what was intended. Neither one tells you what actually took effect at the moment the build ran in that specific stage.

So when someone asks "is the variable configured?" the natural move is to check the dashboard and the config files. Those are organized, readable, and reassuring. They also answer a different question than the one that actually matters.

The Check That Almost Never Gets Done

Stop reading more config. Go look at the artifact.

For a compiled frontend bundle, this means opening the output files and searching for a known substring of the expected API key value. If the key was present during the build, it'll be sitting there in plain text. If it wasn't, that'll be obvious too. This takes about five minutes and is almost never part of anyone's verification process.

Same logic extends to other deployment types:

  • Bundled frontends: search the compiled static files for the value (or for proof of its absence)
  • Server-side services: hit a real endpoint that exercises the dependency and confirm actual behavior, not just an HTTP 200
  • Build pipelines: read the build logs from the step where the variable is consumed, not just from somewhere in the pipeline

There's a clean line between two different kinds of evidence here. Reading a config file tells you what someone intended. Inspecting the shipped artifact tells you what actually happened. In any serious audit, only one of those is real evidence. The config file is documentation of a plan. The artifact is the outcome of whether that plan worked.

What Changes When You're Doing a Real Review

The right question isn't "is the environment variable configured?" It's "was the environment variable available to the build process at the exact step where it was consumed, and does the output prove it?"

Dashboard screenshots and config file contents are documentation of intent. That's not worthless. It's just not sufficient on its own.

The artifact has no incentive to be polite about what happened. Check it.

More in Features