T3 env lint error on Github CI
Run npm run lint
[email protected] lint next lint❌ Invalid environment variables: { PUSHER_APP_ID: [ 'Required' ], PUSHER_SECRET: [ 'Required' ], CONTENTFUL_SPACE_ID: [ 'Required' ], CONTENTFUL_ACCESS_TOKEN: [ 'Required' ], NEXT_PUBLIC_PUSHER_KEY: [ 'Required' ] } error - Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error file:///home/runner/work/chirp/chirp/src/env.mjs:68 throw new Error("Invalid environment variables") ^ Error: Invalid environment variables at file:///home/runner/work/chirp/chirp/src/env.mjs:68:11 at ModuleJob.run (node:internal/modules/esm/module_job:194:25) Node.js v18.16.0 Error: Process completed with exit code 1. Problem is when I run lint locally I get no errors. This error only shows up on github CI. App deploys on Vercel just fine, it's only the Github CI. And here is my env.mjs also:
4 Replies
Im having this issue as well even though I have specified the env vars in question. Very weird...
Env
Never build your apps with invalid environment variables again. Validate and transform your environment with the full power of Zod.
just had this myself and found a much better solution was to copy my .env.example to .env on the ci side, then the vars get pulled in and validated