Hi all, Cloudflare page not working NextJS14 Node v18.17.1
Hi all, Cloudflare page not working NextJS14 Node v18.17.1


wrangler pages deploy .vercel/output/static

getRequestContext() and process.env is still very confusing. sometimes they work in local, sometimes they dont work in prod, so i made this utility functiongetRequestContext() and process.env should with next dev, wrangler pages dev and productiongetRequestContext())
.env.env files that are locally defined i guess,getRequestContext() i guess.env dont. with getRequestContext() locally.dev.vars are you...?.env.dev.vars woudl work?.env file .dev.vars file that contains the exact same content as your .env file

cache supported btw?

next dev or the previewwrangler pages deploy .vercel/output/static "logs": [
{
"message": [
"Failed to Send Email:",
"[object Object]"
],
"level": "error",
"timestamp": 1712562394309
}
],import 'server-only'
export function getEnv(): Env {
const grc = getRequestContext().env as unknown as Env;
if (grc.SECRET_KEY != null) {
return grc;
} else if (process.env.SECRET_KEY != null) {
return process.env as unknown as Env;
} else {
throw new Error("Env variables are not defined");
}
}