Next.js Discord

Discord Forum

Vercel Server environment variables being populated

Unanswered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
I am currently using using [T3 Env](https://env.t3.gg/) for type safe environment variables however on vercel it seems that the server environment variables aren't pulling in for some reason. it builds fine in locally and builds fine using the Vercel CLI using vercel pull and vercel build.

I have checked that my environment variables are correct in my settings and they are and are set for the right environments.
This is the error I see:
$ next build
 ❌ Invalid environment variables: {
   SUPABASE_URI: [ 'Required' ],
   UNSPLASH_SECRET: [ 'Required' ],
   UPLOADTHING_SECRET: [ 'Required' ],
   UPLOADTHING_APP_ID: [ 'Required' ],
   SUPABASE_SERVICE_ROLE: [ 'Required' ],
   GOOGLE_AI_API_KEY: [ 'Required' ],
   UPSTASH_REDIS_REST_URL: [ 'Required' ],
   UPSTASH_REDIS_REST_TOKEN: [ 'Required' ]
 }
  ⨯ Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
 
 > Build error occurred
 Error: Invalid environment variables
     at onValidationError (file:///vercel/path0/node_modules/@t3-oss/env-core/dist/index.js:29:15)
     at createEnv (file:///vercel/path0/node_modules/@t3-oss/env-core/dist/index.js:35:16)
     at createEnv (file:///vercel/path0/node_modules/@t3-oss/env-nextjs/dist/index.js:12:12)
     at file:///vercel/path0/apps/website/env.mjs:4:20
     at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
     at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
     at async loadConfig (/vercel/path0/node_modules/next/dist/server/config.js:698:36)


the repo can be found here: https://github.com/jacobsamo/Mixie/tree/HOT-FIX-typescript-env-errors

also logged on vercel discussions: https://github.com/orgs/vercel/discussions/7311

0 Replies