Edge runtime doesn't mean Node.js runtime. I learned this the expensive way.
Cloudflare Pages edge runtime is fast. It's also not Node.js. These two facts will ruin your night if you treat them as the same thing.
I was building WealthifyX a Next.js financial calculators suite with Upstash Redis for email subscriptions. I picked Cloudflare Pages because it's fast, cheap, and global. Reasonable call.
Then the Redis client started failing. No clear error, just silent failure on the email subscribe endpoint.
After a few hours of debugging, I found it: Cloudflare Pages runs code in a V8 isolate, not a Node.js process. That isolate strips out Node.js globals Buffer, certain crypto APIs, gone. The Upstash Redis client depended on them.
I had assumed "edge runtime" meant "Node.js, but faster and closer to the user." It doesn't. It's a different environment with a different set of available APIs. The Cloudflare docs say this, but I hadn't read closely enough before committing to the deployment target.
I moved to Vercel. For routes that worked fine in the edge runtime, nothing changed. For the Redis-dependent routes, I added export const runtime = 'nodejs' to explicitly opt into the Node.js runtime.
// api/subscribe/route.ts
export const runtime = 'nodejs'
export async function POST(req: Request) {
// Upstash Redis client works fine here
}
Migration took a few hours. Zero downtime, zero data loss.
Check whether your third-party clients support edge runtimes before picking a host. Most client libraries have a section in their docs about this. Upstash does, I just didn't check it first.
Edge runtimes are worth using. But they're not Node.js, and assuming they are is how you end up migrating at 2am.