This repository was archived by the owner on Dec 20, 2024. It is now read-only.
Replies: 3 comments 1 reply
-
|
@jacobsamo Are your env vars set to be available during preview deployments? |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Turns out i needed to set my environment variables into the build env's in the "build": {
... new items
"env": [
"NEXT_PUBLIC_*",
"NODE_ENV",
"UNSPLASH_SECRET",
"UPLOADTHING_SECRET",
"UPLOADTHING_APP_ID",
"SUPABASE_SERVICE_ROLE",
"GOOGLE_AI_API_KEY",
"UPSTASH_REDIS_REST_URL",
"UPSTASH_REDIS_REST_TOKEN",
"RESEND_API_KEY"
],
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This discussion was automatically locked because the community moved to a new site. Please join us at vercel.community |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
When running builds on Vercel my server environment variables aren't being populated.
Example
https://github.com/jacobsamo/Mixie/tree/dev
Steps to Reproduce
For some reason my server environment variables won't pull into my nextjs app on vercel, I have checked that my environment variables are correct in my settings and they are and are set for the right environments.
I am using using T3 Env for type safe environment variables, i have tried just using
process.envtoo but no luck. It builds fine locally and fine when using the Vercel CLI usingvercel pullandvercel buildlocally but not on vercel.This is the error I see:
mixie/website:build: $ next build @mixie/website:build: ❌ Invalid environment variables: { @mixie/website:build: SUPABASE_URI: [ 'Required' ], @mixie/website:build: UNSPLASH_SECRET: [ 'Required' ], @mixie/website:build: UPLOADTHING_SECRET: [ 'Required' ], @mixie/website:build: UPLOADTHING_APP_ID: [ 'Required' ], @mixie/website:build: SUPABASE_SERVICE_ROLE: [ 'Required' ], @mixie/website:build: GOOGLE_AI_API_KEY: [ 'Required' ], @mixie/website:build: UPSTASH_REDIS_REST_URL: [ 'Required' ], @mixie/website:build: UPSTASH_REDIS_REST_TOKEN: [ 'Required' ] @mixie/website:build: } @mixie/website:build: ⨯ Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error @mixie/website:build: @mixie/website:build: > Build error occurred @mixie/website:build: Error: Invalid environment variables @mixie/website:build: at onValidationError (file:///vercel/path0/node_modules/@t3-oss/env-core/dist/index.js:29:15) @mixie/website:build: at createEnv (file:///vercel/path0/node_modules/@t3-oss/env-core/dist/index.js:35:16) @mixie/website:build: at createEnv (file:///vercel/path0/node_modules/@t3-oss/env-nextjs/dist/index.js:12:12) @mixie/website:build: at file:///vercel/path0/apps/website/env.mjs:4:20 @mixie/website:build: at ModuleJob.run (node:internal/modules/esm/module_job:222:25) @mixie/website:build: at async ModuleLoader.import (node:internal/modules/esm/loader:323:24) @mixie/website:build: at async loadConfig (/vercel/path0/node_modules/next/dist/server/config.js:698:36)My builds have been running fine for the past few months but seems that my latest changes on dev have broken it, as master still builds fine on vercel.
Beta Was this translation helpful? Give feedback.
All reactions