do we tell users to run `wrangler deploy` somewhere? 😲 if so please let me know as that needs amend
do we tell users to run
if so please let me know as that needs amending! 
wrangler 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
But when I was using process.env it worked on production but not locally and now that I am using env and getRequestContext it works locally but not in production lol
.env file? (those are only available/populated by next dev but not by wrangler pages dev nor in the deployed application)My .env file atm has nothing in it related to bindingsweird
env.d.ts file is only for providing the correct types, it doesn't effect what it made availabe or not (also I thought the issue could have been string bindings, not actual bindings, the latter doesn't really have anything to do with .env files)process.env.DB but if you do getRequestContext().env.DB you can't access your binding? env.d.ts doesn't matter too much, in your code you can do: (process.env as any).DB and see if it contains the binding getOptionalRequestContext instead of process.env?
getRequestContext be used for production bindings (deployed on Cloudflare pages) or only local development?getRequestContextWorkersPagesPages@cloudflare/next-on-pages.vercel/output/static/_worker.jsgetRequestContextgetRequestContextgetRequestContextdrizzlegetOptionalRequestContextgetOptionalRequestContextnext devwrangler pages devenv.d.tsenv.d.tsprocess.env.DBgetRequestContext().env.DB(process.env as any).DBimport { 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 };env.d.ts
declare global {
namespace NodeJS {
interface ProcessEnv {
DB: D1Database;
DOCUMENTS_BUCKET: R2Bucket;
}
}
}
export {}env.d.ts
interface CloudflareEnv {
DB: D1Database;
DOCUMENTS_BUCKET: R2Bucket;
}import { drizzle } from "drizzle-orm/d1";
export const runtime = "edge";
const db = drizzle((process.env as any).DB);
export { db };