Skip to content

fix(release): validate the env the BUILD sees, not the file on your laptop - #687

Merged
thinkclay merged 1 commit into
mainfrom
fix/eas-env-actually-reaches-build
Sep 1, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/eas-env-actually-reaches-build

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Closes #686.

The 1.17.0 / 11700 build now on TestFlight has no Mapbox token in it. I found it by pulling the shipped .ipa apart, not by reading config.

mapbox token pk.*            ABSENT everywhere
google client id             ABSENT everywhere
Info.plist MBXAccessToken    ABSENT

supabase url                 PRESENT   <- declared in eas.json
posthog host                 PRESENT   <- declared in eas.json

Everything eas.json declares arrived. Nothing else did. .env.production is gitignored, so it never reaches the EAS worker and the dotenv.config() in app.config.ts finds nothing there.

This script is why it went unnoticed

Its own comment claimed the rest of the vars "come from .env.production at build time". So it read that file, confirmed four variables, live-pinged the Mapbox token and got a 200, printed a row of ticks — and then shipped a binary containing none of them.

I ran it before shipping, believed it, and reported the build as verified. A check that is confident and wrong is worse than no check.

What changes

The required-var check now asks EAS what the build will see — the profile's env block plus registered EAS environment variables — and fails with the exact remediation command per variable. On the project as it stands today it correctly refuses:

✗ These vars will NOT reach the build — the binary ships without them:
    - EXPO_PUBLIC_MAPBOX_TOKEN
    - EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID
    - EXPO_PUBLIC_GOOGLE_IOS_SCHEME
    - EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID

  Having them in .env.production is not enough. That file is gitignored and
  never reaches the EAS worker. Register each one with:
    (cd apps/scaffald && pnpm exec eas env:create --environment production \
        --name EXPO_PUBLIC_MAPBOX_TOKEN --value '<value>' --visibility sensitive)
  ...

The Mapbox live-ping is kept but relabelled: it proves the token in your local file is alive, which is not the same claim as the build carrying it. Conflating those two is the entire bug.

What this deliberately does not do

Register the values. They are API tokens; the script prints the commands rather than moving secrets around as a side effect. #686 has the list.

🤖 Generated with Claude Code

…aptop

The 1.17.0 / 11700 build now on TestFlight has no Mapbox token in it.

I found it by pulling the shipped .ipa apart rather than by reading config:

  mapbox token pk.*        ABSENT everywhere
  google client id         ABSENT everywhere
  MBXAccessToken           ABSENT (Info.plist)
  supabase url             PRESENT   <- declared in eas.json
  posthog host             PRESENT   <- declared in eas.json

Everything eas.json declares arrived. Nothing else did. `.env.production` is
gitignored, so it never reaches the EAS worker, and the `dotenv.config()` in
app.config.ts finds nothing there. The map is a headline feature of this app
and it is dead in that build.

The reason it went unnoticed is this script. Its own comment claimed the rest
of the vars "come from .env.production at build time" — so it read that file,
confirmed four variables, live-pinged the Mapbox token, printed ticks, and
then shipped a binary containing none of them. A check that is confident and
wrong is worse than no check: I ran it before shipping, believed it, and said
so.

The required-var check now asks EAS what the build will actually see — the
profile's `env` block in eas.json, plus registered EAS environment variables —
and fails with the exact `eas env:create` command per missing variable. On the
current project it correctly refuses:

  ✗ These vars will NOT reach the build — the binary ships without them:
      - EXPO_PUBLIC_MAPBOX_TOKEN
      - EXPO_PUBLIC_GOOGLE_IOS_CLIENT_ID
      - EXPO_PUBLIC_GOOGLE_IOS_SCHEME
      - EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID

The Mapbox ping is kept but relabelled: it proves the token in your local file
is alive, which is not the same claim as the build carrying it. That conflation
is the whole bug.

Registering the values is deliberately left to a human — they are API tokens,
and this script now prints the commands rather than trying to move secrets
around itself. See the issue for the full binary evidence.
@thinkclay
thinkclay merged commit 32af009 into main Sep 1, 2026
3 checks passed
@thinkclay
thinkclay deleted the fix/eas-env-actually-reaches-build branch September 1, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The 1.17.0 TestFlight build shipped with no Mapbox token — .env.production never reaches the EAS worker

1 participant