Astro Zod environment variable validation

How can I implement the same pattern T3 app uses in env.mjs uses in Astro?
5 Replies
ahkhanjani
ahkhanjani2y ago
anyone?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
ahkhanjani
ahkhanjani2y ago
Astro already pulls an env.mjs of its own with some default values. Wouldn't it conflict with our custom one? And how do you make the code run on build time? In Next you import it in next.config.cjs. I think something went wrong when I tried it in astro.config.ts. Can you confirm these two
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
ahkhanjani
ahkhanjani2y ago
It doesn't have an env.mjs in the project, but it creates one in the background apparently. I noticed it in the network tab. I guess I'll need to play with things or ask the Astro team themselves then
Want results from more Discord servers?
Add your server