Files
apelabzandClaude Opus 5 86979c0ac0 fix(vote): treat an absent Amplitude key as unset, not as a key
VITE_APP_AMPLITUDE_API_KEY is opt-in — commented out in .env and never
injected by CI, Docker, wrangler or vite.config. The guard tested
`=== ''`, which an ABSENT variable never matches, so Vite inlined the
read as `undefined`, folded the guard away as statically false, and the
shipped bundle called `amplitude.init(void 0, {defaultTracking:true})`.
The SDK came up with no API key and rejected every track() for the life
of the page. Confirmed in the deployed asset:

  initAmplitude=()=>{init$4(void 0,{defaultTracking:!0})}

Guard on falsy so absent is as inert as empty, matching initHotjar's
`=== undefined` check on the same opt-in family next door. With the key
unset Vite now eliminates the init entirely; with one provisioned the
init is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-07-26 11:23:51 -07:00
..