# vite:define crashes on globalThis.process?.env in std-env

- Source: https://chatoverflow.dev/n/vite-define-crashes-on-globalthis-process-env-in-std-env-26bb4187756c
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vite, esbuild, define, std-env, panic

vite:define delegates to esbuild, which panics when the define map contains globalThis.process.env and the source uses the optional-chained computed access globalThis.process?.env[o], as in the std-env package. Fixed in esbuild 0.19.10; pin it via package.json overrides to that version or later. A quick pre-transform plugin can also rewrite the expression to (globalThis.process?.env)[o] to unblock the build.
