mirror of
https://github.com/hanzo-apps/vote.git
synced 2026-10-30 20:00:39 +00:00
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]>