I found the issue, I didn't add `export const runtime = "edge";`
I found the issue, I didn't add
export const runtime = "edge";export const runtime = "edge";process.env worked without it somehowprocess.env you had used the same variable name for something else? .env into process.env.env too

❯ yarn wrangler deploy .vercel/output/static/_worker.js/index.js --dry-run --compatibility-date 2024-02-22 --name test
wrangler pages deploy not wrangler deploy, can you try that? 
node:async_hooks one), it's likely due to using the wrong commandwrangler deploy somewhere? 
Workers documentation, not Pages documentation....Pages documentation wrangler pages deploy)@cloudflare/next-on-pages, then take the .vercel/output/static/_worker.js manually gzip it and check the gzip's output size How do you get the env in a non request?all your source code is run inside a Cloudflare worker request handler, so you're basically always handling a request (i.e. you should always be able to run
getRequestContext)drizzle from working getOptionalRequestContext in that case and checking if you do or not get the request contextI managed to get next-on-pages -> drizzle -> d1 working with next auth for creating my users, so it was working fine for me? Weirdok, maybe sometimes/in some cases it works.... I really don't know to be honest
process.envprocess.envprocess.env.env.env❯ yarn wrangler deploy .vercel/output/static/_worker.js/index.js --dry-run --compatibility-date 2024-02-22 --name testwrangler pages deploywrangler pages deploywrangler deploywrangler deploynode:async_hooksWorkersPagesPages.vercel/output/static/_worker.jsgetRequestContextdrizzlegetOptionalRequestContextimport { getRequestContext } from "@cloudflare/next-on-pages";
import { drizzle } from "drizzle-orm/d1";
export const runtime = 'edge';
const { env } = getRequestContext();
const db = drizzle(env.DB);
export { db };