Deploy T3 stack on Fly.io

I get this error when i try to run fly deploy
#0 2.229 ❌ Invalid environment variables: {
#0 2.229 DATABASE_URL: [ 'Required' ],
#0 2.229 NEXTAUTH_SECRET: [ 'Required' ],
#0 2.229 NEXTAUTH_URL: [ 'Required' ],
#0 2.229 DISCORD_CLIENT_ID: [ 'Required' ],
#0 2.229 DISCORD_CLIENT_SECRET: [ 'Required' ],
#0 2.229 AWS_ACCESS_KEY_ID: [ 'Required' ],
#0 2.229 AWS_SECRET_ACCESS_KEY: [ 'Required' ]
#0 2.229 }
#0 2.230 - error Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
#0 2.236
#0 2.236 > Build error occurred
#0 2.237 Error: Invalid environment variables
#0 2.237 at f (file:///app/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:386)
#0 2.237 at l (file:///app/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:576)
#0 2.237 at C (file:///app/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:749)
#0 2.237 at file:///app/src/env.mjs:4:20
#0 2.237 at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
#0 2.229 ❌ Invalid environment variables: {
#0 2.229 DATABASE_URL: [ 'Required' ],
#0 2.229 NEXTAUTH_SECRET: [ 'Required' ],
#0 2.229 NEXTAUTH_URL: [ 'Required' ],
#0 2.229 DISCORD_CLIENT_ID: [ 'Required' ],
#0 2.229 DISCORD_CLIENT_SECRET: [ 'Required' ],
#0 2.229 AWS_ACCESS_KEY_ID: [ 'Required' ],
#0 2.229 AWS_SECRET_ACCESS_KEY: [ 'Required' ]
#0 2.229 }
#0 2.230 - error Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error
#0 2.236
#0 2.236 > Build error occurred
#0 2.237 Error: Invalid environment variables
#0 2.237 at f (file:///app/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:386)
#0 2.237 at l (file:///app/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:576)
#0 2.237 at C (file:///app/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:749)
#0 2.237 at file:///app/src/env.mjs:4:20
#0 2.237 at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
What i should do? I tried many things that didn't work, I can wipe all the setup with .mjs... for env variables, but I'll loose typesafety
3 Replies
Rhys
Rhys17mo ago
Have you set those env variables on fly.io?
Axibord
AxibordOP17mo ago
Yes I found the solution I added ENV SKIP_ENV_VALIDATION=1 on the generated Dockerfile by Fly.io
K1|ller
K1|ller16mo ago
Same issue but with Vercel, so you just add empty variables?
Want results from more Discord servers?
Add your server