I sometimes put stringified JSON and has bunch of env variable keys. It’s hard to know when there’s an issue within the env value unless we really understand the whole env vars we define and where its used beneath the app.
Astro v5 has env validator built in. t3-env
lib also serves this purpose. It’s also possible to write custom validator and run it as custom script.
I look for seamless validation on my vite app and glad that there’s a vite plugin for it: @julr/vite-plugin-validate-env. It runs on dev & build time only and support zod.