npx next build but you are using yarn, could you update the command to use yarn's alternative and try again? yarn install to update the lock file, push the change and try again?develop branch, let me try main....main: https://github.com/dario-piotrowicz/skill-tree-frontend/tree/mainsrc/server/db.ts ▲ Error: Failed to retrieve the Cloudflare request context. error when doing a next build. it works fine in developmentprocess.env.NODE_ENV === "development"
? getRequestContext().env.DB
: (process.env as any).DB worksbeta release you can just use process.env.DB both in development and production (process.env not working in development was a bug I've fixed here: https://github.com/cloudflare/next-on-pages/pull/690)getRequestContext() and not process.env, but it seems like getRequestContext() has some bug that makes it not work in some cases, I'll definitely look into that the only thing is that I haven't gotten a minimal reproduction to play with that till now (I did briefly tried to reproduce it with no luck, I should also try that again if I can't get a minimal repro)kv-asset-handler? (https://github.com/cloudflare/workers-sdk/tree/main/packages/kv-asset-handler)public folder.example.com with a static file favicon.ico.example.com/favicon.ico.
@cloudflare/next-on-pages is for deploying full-stack Next.js apps to Cloudflare Pages. Therefore, you should be using native Next.js features. The functions directory will not work with next-on-pages because we have our own worker to handle your requests. If you want to use the functions directory, you won't be able to use next-on-pagesvercel.json, but it doesn't seem to be working :/yarn install, I didn't do anything else

"use server";
import { getRequestContext } from "@cloudflare/next-on-pages";
import { Repository, getDB } from "@my-separate-package/db";
export const db = getDB(getRequestContext().env.DB ?? process.env.DB);
export const repository = new Repository(db);process.env.NODE_ENV === "development"
? getRequestContext().env.DB
: (process.env as any).DBvercel.json