next.js worker not finding environment variables

hi! i have a cloudflare worker that i'm trying to deploy and have environment variables that i'm using. i've added the environment variables within the env variables within the worker but the build isn't able to find it (i'm using https://github.com/t3-oss/t3-env to manage my env variable validations). would anyone know how i can further debug this issue? if i have a local .env file, the build works smoothly and as such believed the worker build environment would read from the environment variables for more reference, this is how my env.ts file looks like :
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

export const env = createEnv({
server: {
NEWS_API_ENDPOINT: z.string().url(),
NEWS_API_API_KEY: z.string().min(32),
OPENAI_SECRET_KEY: z.string().min(1),
OPENAI_ORG_ID: z.string().min(1),
CHRONICLE_R2_ENDPOINT: z.string().url(),
CHRONICLE_R2_ACCESS_ID: z.string().min(1),
CHRONICLE_R2_SECRET_KEY: z.string().min(1),
CHRONICLE_R2_BUCKET_NAME: z.string().min(1),
},
client: {},
// For Next.js >= 13.4.4, you only need to destructure client variables:
experimental__runtimeEnv: {},
});
import { createEnv } from "@t3-oss/env-nextjs";
import { z } from "zod";

export const env = createEnv({
server: {
NEWS_API_ENDPOINT: z.string().url(),
NEWS_API_API_KEY: z.string().min(32),
OPENAI_SECRET_KEY: z.string().min(1),
OPENAI_ORG_ID: z.string().min(1),
CHRONICLE_R2_ENDPOINT: z.string().url(),
CHRONICLE_R2_ACCESS_ID: z.string().min(1),
CHRONICLE_R2_SECRET_KEY: z.string().min(1),
CHRONICLE_R2_BUCKET_NAME: z.string().min(1),
},
client: {},
// For Next.js >= 13.4.4, you only need to destructure client variables:
experimental__runtimeEnv: {},
});
i'm using all the variables on server side and nothing on the client. would love to provide more information - appreciate the help!!
GitHub
GitHub - t3-oss/t3-env
Contribute to t3-oss/t3-env development by creating an account on GitHub.
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server